Created
September 3, 2010 05:24
-
-
Save daqing/563457 to your computer and use it in GitHub Desktop.
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
def v2ex_api(path) | |
url = URI.parse("http://v2ex.appspot.com") | |
res = Net::HTTP.start(url.host, url.port) do |http| | |
http.get(path) | |
end | |
ActiveSupport::JSON.decode res.body | |
end | |
puts v2ex_api("/api/members/show.json?username=daqing").inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment