[your code here]

Hello hello at world.com
Sat May 4 04:15:30 UTC 2019


string weather(float latitude, float longitude)
{
     import std.regex;
     import std.net.curl;
     import std.format;
     import std.conv;

     auto r = regex(q{<span class="summary swap">(.+)</span>});

     foreach (line; 
byLine(format("https://darksky.net/forecast/%f,%f/ca24/en", 
latitude, longitude)))
         foreach (c; matchAll(line, r))
             return c[1].to!string;

     return "bug";
}

void main()
{
     import std.stdio;
     weather(52.517, 13.3889).writeln;
}


More information about the Digitalmars-d mailing list