Skip navigation

I’ve been experimenting with Facebook API. First step in using it is to get a token. This requires some user interaction. I started with code from Mining The Social Web. You can download the login script here:

https://github.com/ptwobrussell/Mining-the-Social-Web/blob/master/python_code/facebook__login.py

I made one modification. I’m using Python for Cygwin so the webbrowser class doesn’t really work. Instead I replaced line 76 with:

os.system('chrome "https://graph.facebook.com/oauth/authorize?'
+ urllib.urlencode(args) + '"')

and in Cygwin I created a symlink to the chrome executable in /usr/bin/ . Now when I run the script the access token loads in chrome. That’s it.

Stay tuned for part two where I’ll be showing you some of the fun I’ve been having gathering data about my FB friends 🙂

Leave a Reply