LOoLzeC

react.py

Dec 10th, 2018
752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.88 KB | None | 0 0
  1. #!/usr/bin/python
  2. #-*-coding:utf-8-*-
  3. # Auto Reactions Grup By Deray
  4. # Required Modules
  5. import requests,json,sys,time
  6. # Manual Color
  7. W  = '\033[1;37m'
  8. N  = '\033[0m'
  9. R  = '\033[1;37m\033[31m'
  10. B  = '\033[1;37m\033[34m'
  11. G  = '\033[1;32m'
  12. O = '\033[33m'
  13. print """
  14. ___  ___ _____
  15. | _ )/ _ \_   _|
  16. | _ \ (_) || | Facebook Auto
  17. |___/\___/ |_| Reaction Group
  18.  By Deray <3
  19. """
  20. class react():
  21.     def __init__(self):
  22.         self.grup=[]
  23.         self.no=[]
  24.         self.ck()
  25.     def ck(self):
  26.         try:
  27.             self.tk=raw_input(R+"[!]"+N+" Your Token List: ")
  28.             self.token=open(self.tk).read().split("\n")[0]
  29.             self.maen()
  30.         except Exception as f:
  31.             print R+"[!] "+N+str(f)
  32.             self.ck()
  33.     def maen(self):
  34.         r=requests.get("https://graph.facebook.com/me/groups?access_token="+self.token).text
  35.         s=json.loads(r)
  36.         for x in s["data"]:
  37.             self.grup.append(x["name"] + " => "+N+G+x["id"]+N)
  38.         print """
  39.     [ SEARCH YOUR GRUOP ]
  40.         """
  41.         self.search()
  42.     def search(self):
  43.         r=raw_input(G+"[*]"+N+" Query: ")
  44.         if r == "":
  45.             print R+"[!]"+N+" Please enter grup query."
  46.             self.search()
  47.         else:
  48.             for x in self.grup:
  49.                 if not r in x:
  50.                     pass
  51.                 else:
  52.                     self.no.append(x)
  53.                     print R+"[!] "+N+x.replace(r,O+r+N)
  54.             if len(self.no) == 0:
  55.                 print R+"[-]"+N+" Not Found:",r
  56.                 self.no=[]
  57.                 self.search()
  58.             else:
  59.                 self.ids=raw_input(B+"\n[*]"+N+" Paste ID HERE: ")
  60.                 try:
  61.                     self.reaction()
  62.                 except:sys.exit(R+"\n[+] "+N+"Byee")
  63.     def reaction(self):
  64.         ap=[]
  65.         self.limit=raw_input(R+"[!] "+N+"Limit Post You Want To Get: ")
  66.         try:
  67.             print "[*] Retrieving "+R+self.limit+N+" Post ID From",G+requests.get('https://graph.facebook.com/'+self.ids+'?access_token='+self.token).json()["name"]
  68.             r=requests.get("https://graph.facebook.com/"+self.ids+"/feed?limit="+self.limit+"&access_token="+self.token).text
  69.             self.js=json.loads(r)
  70.         except Exception as f:
  71.             print R+"\n[ERROR]: "+N+str(f)
  72.             sys.exit(R+"\n[!] "+N+"Unknown ID or Group is Private?:(")
  73.         print """
  74.  {}1{}){} LIKE
  75.  {}2{}){} HAHA
  76.  {}3{}){} SAD
  77.  {}4{}){} ANGRY
  78.  {}5{}){} WOW
  79.  {}6{}){} LOVE
  80.         """.format(B,R,N,B,R,N,B,R,N,B,R,N,B,R,N,B,R,N)
  81.         self.tipe=raw_input("Menu: ").replace("1","LIKE").replace("2","HAHA").replace("3","SAD").replace("4","ANGRY").replace("5","WOW").replace("6","LOVE")
  82.         print R+"[!] "+N+"React Type:",G+self.tipe
  83.         print R+"[!]"+N+" Starting Bot ..."
  84.         for x in self.js["data"]:
  85.             payload = {'access_token' : self.token , 'type' : self.tipe}
  86.             s = requests.post("https://graph.facebook.com/"+x["id"]+"/reactions", data = payload).text
  87.             if "true" in s:
  88.                 try:
  89.                     print G+"[ID| "+N+x["id"].split('_')[1]+" --> "+x["message"][0:20]+" .."
  90.                 except:
  91.                     try:
  92.                         print G+"|ID| "+N+x["id"].split('_')[1]+" --> "+x["story"][0:20]+" .."
  93.                     except:pass
  94.             else:
  95.                 try:
  96.                     print R+"|ID| "+N+x["id"].split('_')[1]+" => GAGAL"
  97.                 except:pass
  98.         print "\n[*] Done."
  99.        
  100. react()
Advertisement
Add Comment
Please, Sign In to add comment