Skip to content

Instantly share code, notes, and snippets.

@nrk
Created August 20, 2008 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrk/6376 to your computer and use it in GitHub Desktop.
Save nrk/6376 to your computer and use it in GitHub Desktop.
Parsing posts from tumblr using JSON
// Parsing posts from tumblr using JSON
JSON
Regex
Map squareBrackets := method(
return self at(call evalArgs at(0))
)
URL with("http://staff.tumblr.com/api/read/json") fetch findRegex("^var tumblr_api_read = (.*);\s*$") ?at(1) fromJSON ["posts"] foreach(post, post ["type"] println)
/*
regular
regular
photo
regular
regular
link
link
photo
photo
link
photo
photo
photo
quote
photo
photo
regular
photo
regular
photo
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment