Created
August 20, 2008 15:13
-
-
Save nrk/6386 to your computer and use it in GitHub Desktop.
This is the same as http://gist.github.com/6376 but written in Lua
This file contains hidden or 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
http = require "socket.http" | |
require "json" | |
local json_res = http.request("http://staff.tumblr.com/api/read/json") | |
local tumblr = json.decode(string.match(json_res, "^var tumblr_api_read = (.*);%s*$")) | |
for _, post in ipairs(tumblr.posts) do print(post.type) end | |
--[[ **** OUTPUT **** | |
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