diff --git a/dscheme/dscheme.d b/dscheme/dscheme.d index b294ba5..96a2676 100644 --- a/dscheme/dscheme.d +++ b/dscheme/dscheme.d @@ -1,18 +1,16 @@ module dscheme; import tlscheme2json; -enum DEFAULT_SCHEME_URL = "https://raw.githubusercontent.com/ErnyTech/TLScheme2Json/master/TLScheme.json"; class DScheme { private static TLClass[] tlClasses; static this() { - import std.stdio : writeln; - import std.net.curl : get; import asdf : deserialize; - writeln("Obtaining TLScheme Json from " , DEFAULT_SCHEME_URL); - auto jsonScheme = get(DEFAULT_SCHEME_URL).dup; + auto parser = new TLScheme2Json(); + parser.parse; + auto jsonScheme = parser.toJson; auto tljson = deserialize!TLJson(jsonScheme); this.tlClasses = tljson.tl_classes; } @@ -20,4 +18,4 @@ class DScheme { static TLClass get() { return this.tlClasses; } -} \ No newline at end of file +}