Created
November 18, 2009 18:54
-
-
Save carrot/238139 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
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