Automate Facebook Status Update Without Facebook API

written by Arief Bayu Purwanto on November 20, 2009 in snippet with 6 comments

Sweet little snippet with only 10 lines of code! Using python mechanize library to update your facebook status. Check out the code:

from mechanize import Browser
br = Browser()
br.open( "http://lite.facebook.com/" )
br.select_form(nr=0)
br.form['email'] = 'youremail@example.com'
br.form['password'] = 'yourpassword'
br.submit()
br.select_form(nr=1)
br.form['message'] = 'the force is strong with you...'
br.submit()