Skip to content

Instantly share code, notes, and snippets.

@brianmichel
Created April 9, 2010 19:35
Show Gist options
  • Save brianmichel/361497 to your computer and use it in GitHub Desktop.
Save brianmichel/361497 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby -w
require 'net/http'
require 'rexml/document'
url = "http://#{ARGV[0]}.tumblr.com/api/read"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
if(xml_data)
doc = REXML::Document.new(xml_data)
a = doc.root.elements["posts/post/"].attributes["url"]
print a + "\n"
else
print "oops wasn't able to get anything!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment