Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (81 sloc) 2.77 KB
# -*- coding: utf-8 -*-
import os
import sys
import webbrowser
import urllib
def login():
# Get this value from your Facebook application's settings
# You could customize which extended permissions are being requested on the login
# page or by editing the list below. By default, all the ones that make sense for
# read access as described on
# are included. (And yes, it would be probably be ridiculous to request this much
# access if you wanted to launch a successful production application.)
args = dict(client_id=CLIENT_ID, redirect_uri=REDIRECT_URI,
scope=','.join(EXTENDED_PERMS), type='user_agent', display='popup'
+ urllib.urlencode(args))
# Optionally, store your access token locally for convenient use as opposed
# to passing it as a command line parameter into scripts...
access_token = raw_input('Enter your access_token: ')
if not os.path.isdir('out'):
filename = os.path.join('out', 'facebook.access_token')
f = open(filename, 'w')
print >> sys.stderr, \
"Access token stored to local file: 'out/facebook.access_token'"
return access_token
if __name__ == '__main__':
You can’t perform that action at this time.