Mass Commenting on Facebook Posts

Now a days, automation is a very common task, and, we like it very much too. Specially, automating the different tasks on social media using their API.

I’ve written so many  scripts in JavaScript and Python to automate tasks, and I love doing it.  So, today, I’m gonna share a cool Python Code so that you can comment even 1000 + times on any Facebook Post within a minute or second.  🙂

STARTING FROM HERE :

STEP 1 :  Visit

 https://developers.facebook.com 

STEP 2 : Goto

 Tools and Support 

and click on

 Graph API Explorer 

STEP 3 : Now, you have a Dashboard. So, click on

 Get Token 

and select all the options given there and then click on

 Get Access Token 

Screenshot from 2015-10-16 02:28:11

STEP 4 : Copy the whole text, which looks something like

 CAACEdEose0cBAJvBp2wDtZACv1rpARZBRZALOUZBcxrrfIFN5uHZAjkLtFtnZCzpZBtKfxnhELz7Eg93gBDldzjVXQIdxLh74fDNns3eGLrG9VEs93CTa3ZCddY7ak4eo7pQfZB3wGjMwbk5gsX3MhVgwNSCkTF0zxJ04xXYpsWZBVNj1fyB4u9RyyZA4qFAABwH57VNoxHRwFkdQZDZD 

and paste it in your text favorite text editor.

STEP 5 : Now open the facebook status in which you want to comment and visit it’s link, which is something like

https://www.facebook.com/photo.php?fbid=745475902231212&set=a.106729816105827.13061.100003064262860&type=3

and copy the numbers after ?fbid. In this post, the comment id is :

 745475902231212 

STEP 6 : Download the Code from here :

Facebook Mass Commenter

STEP 7 : Open the file and fill the informations.

STEP 8 : Open Terminal using

 Ctrl + Alt + T 

and type

python comments.py

and hit enter.

STEP 9 : Congrats! Check the facebook post 😀

You can have a look on the code, I’ve given the link to download, just in case if you don’t want to copy paste it.


import httplib, urllib 
from bs4 import BeautifulSoup 
import os 
import json
import time

access_token='ACCESS TOKEN PLEASE!'
conn = httplib.HTTPSConnection("graph.facebook.com") 
print 'Please Wait!'
 
def comment(url): 
    connect = httplib.HTTPSConnection("graph.facebook.com") 
    connect.request("GET",url) 
    for x in xrange(1000):         
            
            print 'commenting %d '% x
            path ='/'+'PUT FB STATUS ID HERE'+'/comments'
            param_data={  'format':'json', 
                        'message':'Auto Generated Comment', 
                        'access_token':access_token 
                  } 
            connect = httplib.HTTPSConnection("graph.facebook.com") 
            connect.request("POST",path,urllib.urlencode(param_data),{}) 
            time.sleep(0.09)
           
url='/PUT FB STATUS ID HERE'
comment(url) 
print 'DONE!'

Thanks 🙂 I’ll keep posting interesting stuffs on my blog.

Advertisements

One thought on “Mass Commenting on Facebook Posts

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s