Skip to content

Instantly share code, notes, and snippets.

@repeatedly
Last active December 16, 2015 02:19
Show Gist options
  • Save repeatedly/5361232 to your computer and use it in GitHub Desktop.
Save repeatedly/5361232 to your computer and use it in GitHub Desktop.
ugomemo.d
import std.json : JSONValue, parseJSON;
import std.stdio : writefln;
import std.net.curl : get;
void main()
{
auto apiRequest = (string uri) => parseJSON(get(uri));
auto user = apiRequest("http://ugomemo.hatena.ne.jp/[email protected]");
auto movies = apiRequest("http://ugomemo.hatena.ne.jp/11F9E990AA34FFBC@DSi/movies.json");
writefln("%sさんは%d個の作品を投稿しています", user["name"].str, movies["count"].uinteger);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment