Created
April 9, 2010 19:35
-
-
Save brianmichel/361497 to your computer and use it in GitHub Desktop.
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
#!/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