Skip to content

Instantly share code, notes, and snippets.

@johl
Last active December 17, 2015 19:49
Show Gist options
  • Save johl/5662953 to your computer and use it in GitHub Desktop.
Save johl/5662953 to your computer and use it in GitHub Desktop.
Wikidata := Object clone
Wikidata get := method(item,
url := URL clone with("http://www.wikidata.org/w/api.php?action=wbgetentities&ids=" .. item .. "&format=json");
data := url fetch;
Yajl clone parse(data) root at(0) at("entities") at(item);
)
Wikidata get("q42") at("claims") keys map(property, Wikidata get(property) at("labels") at("en") at("value"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment