Facebook API and Python [closed] Facebook API and Python [closed] python python

Facebook API and Python [closed]


I ran across same problem some time ago and later found out that PyFacebook isn't deeply tied up with Django. It just uses a few utils from django.

My recommendation is that you setup PyFacebook alongwith django and then play around with it using command line. To use PyFacebook you won't have to go through or even know anything about django at all.

Here's an example:

from facebook import Facebookapi_key = 'Your App API Key'secret  = 'Your App Secret Key'session_key = 'your infinite Session key of user'fb = Facebook(api_key, secret)fb.session_key = session_key# now use the fb object for playing around

You might need to get an infinite session key which you can get from here: http://www.facebook.com/code_gen.php?v=1.0&api_key=YOUR_API_KEY

Use this code to get convert the code from above URL into infinite session key:

def generate_session_from_onetime_code(fb, code):    fb.auth_token = code    return fb.auth.getSession()print generate_session_from_onetime_code(fb, session_onetime_code)


A new library that is available is:https://github.com/semyazza/Facebook.py

It currently support authentication and the dialog API. Planned in the near future(currently being worked on) is a wrapper around the graph API.

The project goal is to be platform agnostic, single file, and use only standard Python libraries.


How about taking the Facebook Python SDk itself and stripping off the GAE part from it and using the other API calls only?