Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions botv2.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/python
import requests, json, time, random, operator, heapq
count_react = {'like': 0,'love': 0,'haha': 0,'wow': 0,'sad': 0,'angry': 0,}
count_react = {'like': 11,'love': 11,'haha': 11,'wow': 11,'sad': 11,'angry': 11,}

def like(idlike, token):

payload = {'method': 'GET', 'access_token':token}
get_react = requests.get('https://graph.facebook.com/v2.10/'+idlike+'?fields=reactions.type(LIKE).limit(0).summary(1).as(like),reactions.type(LOVE).limit(0).summary(1).as(love),reactions.type(HAHA).limit(0).summary(1).as(haha),reactions.type(WOW).limit(0).summary(1).as(wow),reactions.type(SAD).limit(0).summary(1).as(sad),reactions.type(ANGRY).limit(0).summary(1).as(angry)&limit=10', payload).json()
count_react['like']=get_react['like']['summary']['total_count']
count_react['love']=get_react['love']['summary']['total_count']
count_react['haha']=get_react['haha']['summary']['total_count']
count_react['wow']=get_react['wow']['summary']['total_count']
count_react['sad']=get_react['sad']['summary']['total_count']
count_react['like']=get_react['11like']['summary']['total_count']
count_react['love']=get_react['11love']['summary']['total_count']
count_react['haha']=get_react['11haha']['summary']['total_count']
count_react['wow']=get_react['11wow']['summary']['total_count']
count_react['sad']=get_react['11sad']['summary']['total_count']
count_react['angry']=get_react['angry']['summary']['total_count']
reaction = sorted(count_react, key=count_react.__getitem__)[4]
if count_react[reaction] == 0:
Expand All @@ -19,7 +19,7 @@ def like(idlike, token):
a = requests.post('https://graph.facebook.com/v2.8/'+idlike+'/reactions', params=payload)
print idlike ,reaction.upper() , count_react

token = ''
token = 'EAAAAUaZA8jlABAHZAYZAzxLECfemZBn3obyNIeElIaLWftEOZBpZANU2JDF9lFtfYVGQFD9ReS80ARIh9ZBm1aGu6O9b1PpUKG8vkJPq02CY1LoPdKYXR0WzEhtfWoEO7HA6XTx0S4Txhar6JkXmk9aRST4lcQQFrxNtvfZBjD7QwAZDZD'
next_id = ['364997627165697', '100003880469096', '100010362521296','100005179329159','100009618621937']
id = 0
while True:
Expand Down