Like and comment all the posts on Facebook(using python)
We will need following 2 things:
1. Access token
2. Object Id
Where to get this from????
Goto:
developers.facebook.com->Tools and Support->GraphAPI Explorer
1. Copy access token
2. Click on submit
3. Copy id
Following is the auto-like and auto-comment script:
import facebook
import re
token = "Paste your access token over Here"
graph = facebook.GraphAPI(token)
#pages = ['rahuldravid']
profile = graph.get_object("Paste Your object Id")
posts = graph.get_connections(profile['id'],"posts") // this line would connect us to the facebook profile
for post in posts['data']:
try:
graph.put_object(post['id'],"likes") //this line would like all the posts of facebook
graph.put_comment(post['id'],message="Long live rahul dravid") // I am going to comment "Long live rahul dravid"
print "I am commenting :" +post["message"] // Just to check whether our script is working or not...Lets print message
except:
continue