Facebook Auto Comment Bot Python.
* Video Links:-
(X). How to Generate Access Token and Page Post id.
https://youtu.be/rnGxGVSAk4M
(Y). How to post Comments
https://youtu.be/mEPn5Ef3IKU
* Details:-
1. In this video I am creating an application which will post comments to Facebook Page Post Automatically.
2. I am using 2 Library Packages:-
A. Requests
B. Time
Requests package is used to post comments and time library is used to insert delay between 2 comments. So, that facebook will not reject them.
3. Steps:-
a. Open Facebook application in Desktop PC or Laptop.
b. Open you Facebook Page.
c. In About Section, at last you will get Page Id, just copy it.
f. Now open site:
developers.facebook.com
g. Use this page id in Graph api explorer and get all page posts.
Each post has a post id.
h. Now select your post id on which you want to post comments.
I. Create an App for your Page and generate access token.
j. Now open python editor and start coding.
K. Coding:
import requests
import time
def post_comm(token, id, comment):
post_url=’https://graph.facebook.com/
{}/comments’.format(id)
payload={
'message’:comment,
'access_token’:token
}
r=requests.post(post_url, payload)
print(r.text)
#main section
access_token=’adfhkl'
page_post_id=’adfg_dgjk'
msg=’please subscribe my page'
comments=[]
comments.append(’hello’)
comments.append(’follow me’)
comments.append(’subscribe me’)
for i in range(len(comments)):
post_comm(access_token, page_post_id, comments[I]
time.sleep(2)
Get Computer Coding Class’s stories in your inbox
Join Medium for free to get updates from this writer.
Print('Task completed')
I used Anaconda Command prompt to install packages and editor was Anaconda Spyder.
Links of 2 videoes are given above.
Please watch full Video to know whole process.
#Hashtags:-
#computercodingclass, #python, #coding, #programming, #india,
#tutorial, #learning, #teaching, #computer, #dictionary, #function, #everyone








