Skip to content

Instantly share code, notes, and snippets.

@carrot
Created November 18, 2009 18:54
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/238139 to your computer and use it in GitHub Desktop.
Save carrot/238139 to your computer and use it in GitHub Desktop.
def prepare_user
foursquare = Foursquare.new #instatiate
response = foursquare.request '/v1/user.json', :get #api method
result = response.body
body = JSON.parse(result)
user = body['user'] #parse response and make user variable
#this is where it gets hairy. how should I construct this hash so that I can easily pull out the uid param for verifification
newuser[uid] = user['id']
newuser[first] = user['firstname']
newuser[last] = user['lastname']
newuser[twitter] = user['twitter']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment