Facebook scripting in Python

I just came across this blog that shows an easy way to play with facebook api using python. It is
micro api client that implements the client-side authentication flow and has a few utility functions for accessing the graph api and fql.

But unfortunately I am getting error while trying with this code:

from urllib import urlretrieve
import imp
urlretrieve('https://raw.github.com/gist/1194123/fbconsole.py', '.fbconsole.py')
fb = imp.load_source('fb', '.fbconsole.py')

fb.AUTH_SCOPE = ['stream_publish']
fb.authenticate()

status = fb.graph_post("/me/feed", {"message":"Hello this is from python"})

Comments

Nancy said…
Did you try grabbing the rest of the code from https://raw.github.com/gist/1194123/fbconsole.py ? I didn't try it myself, so just wondering.
Anonymous said…
You have to change stream_publish to publish_stream. This was a bug in the original post that has been fixed.
Tamim Shahriar said…
@pcardune, thanks, it works!

Popular posts from this blog

Strip HTML tags using Python

lambda magic to find prime numbers

Convert text to ASCII and ASCII to text - Python code