Last active
December 16, 2015 02:19
-
-
Save repeatedly/5361232 to your computer and use it in GitHub Desktop.
ugomemo.d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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