Created
April 22, 2017 10:26
-
-
Save tap222/cb85f21211cbbe2a36c6ef17d113c402 to your computer and use it in GitHub Desktop.
Facebook Spammer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fb #To install this package run: sudo pip install fb | |
from facepy import GraphAPI #To install this package run: sudo pip install facepy | |
import time | |
token=""#Insert access token here. | |
facebook=fb.graph.api(token) | |
graph1 = GraphAPI(token) | |
vid=102988293558 #This is flipkart page's facebook id | |
query=str(vid)+"/posts?fields=id&limit=5000000000" | |
r=graph1.get(query) | |
idlist=[x['id'] for x in r['data']] | |
print("There are "+ str(len(idlist)) +" commentable posts.") | |
char1='y' | |
count=0 | |
if char1=='y': | |
nos=input("Enter number of posts to be commented on: ") | |
if nos<=len(idlist): | |
for indid in idlist[len(idlist)-(nos):len(idlist)-1]: | |
count=count+1 | |
facebook.publish(cat="comments",id=indid,message="Complaint goes here"+str(count)) | |
time.sleep(6) | |
print("Complaint number:"+str(count)+" on www.facebook.com/"+str(indid).split('_')[0]+"/posts/"+str(indid).split('_')[1]) | |
else: | |
print("Not that many commentable posts available. ") | |
else : | |
print("No complaints made.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment