Skip to content

Commit

Permalink
Fixing flaw, getting correctly me information from facebook
Browse files Browse the repository at this point in the history
  • Loading branch information
maraujop committed May 16, 2012
1 parent 0fcb5cd commit 649c8c4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions download.py
Expand Up @@ -629,10 +629,13 @@ def main():
options = parse_args() options = parse_args()


if options.db_file: # FIXME - should do dupe checking if options.db_file: # FIXME - should do dupe checking
response = requests.get('me', params={'access_token': options.access_token}) response = requests.get('https://graph.facebook.com/me', params={'access_token': options.access_token})
user_id = response['id'] if response.ok:
sql = 'INSERT INTO oauth_access_tokens(user_id, code, token) VALUES("%s", "asdf", "%s");' % (user_id, options.access_token) user_id = response.json['id']
schemautil.get_db(options.db_file).executescript(sql) sql = 'INSERT INTO oauth_access_tokens(user_id, code, token) VALUES("%s", "asdf", "%s");' % (user_id, options.access_token)
schemautil.get_db(options.db_file).executescript(sql)
else:
print >> sys.stderr, "There was a problem downloading the user info [%s]" % options.access_token


if options.fql_schema: if options.fql_schema:
fql_schema = schemautil.FqlSchema() fql_schema = schemautil.FqlSchema()
Expand Down

0 comments on commit 649c8c4

Please sign in to comment.