Created
August 6, 2012 02:50
-
-
Save malachaifrazier/3269348 to your computer and use it in GitHub Desktop.
Singly API JSON Parsing
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
<p> Works! Whats up <%= @display_name %> </p> | |
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
# I'm using Sinatra (Ruby). | |
# I get the huge JSON output but can't figure out how to access "screen_name" | |
get "/home" do | |
@title = "ShortJab.me" | |
if session[:access_token] | |
@self = HTTParty.get(self_url,{ | |
:query => {:access_token => session[:access_token]} | |
}).parsed_response | |
end | |
@display_name = JSON.generate(@self) | |
erb :home | |
end | |
kristjan
commented
Aug 6, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment