Search This Blog

Thursday 24 December 2015

Auto Like Facebook Posts using Python

Auto Like Facebook Posts 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 script:

import facebook
token = "Your access token"
graph = facebook.GraphAPI(token)
profile = graph.get_object("Your object id")
posts = graph.get_connections(profile['id'],"posts")
for post in posts['data']:
    try:
        graph.put_object(post['id'],"likes")
        print "I am liking this topic :" +post["message"]
    except: 

        continue





No comments:

Post a Comment