Skip to content

Instantly share code, notes, and snippets.

@carrot
Created November 18, 2009 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carrot/238221 to your computer and use it in GitHub Desktop.
Save carrot/238221 to your computer and use it in GitHub Desktop.
get '/user' do
foursquare = Foursquare.new
response = foursquare.request '/v1/user.json', :get
result = response.body
body = JSON.parse(result)
user = body['user']
return user['firstname'] # works
@user = {:uid => user['id'], :first => user['firstname'], :last => user['lastname'], :twitter => user['twitter']}
return @user[:first] # doesn't work
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment