-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspammer.py
73 lines (50 loc) · 1.96 KB
/
spammer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import os
import tweepy
import random
yoloURL = '' #the url used to attach the yolo dialog to snapchat
yoloUserCode = '' #the code in the url following /m/ and before ?w
initialMsg = 'This is a friendly reminder that this is really annoying on your story. Prepare to be spammed with tweets from president Donald J Trump!'
twitterUser = 'realdonaldtrump'
tweetQuantity = 200
consumer_key = ""
consumer_secret = ""
access_key = ""
access_secret = ""
auth=tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
api=tweepy.API(auth)
# initialize a list to hold all the tweepy Tweets
alltweets=[]
new_tweets=api.user_timeline(screen_name=twitterUser, count=tweetQuantity, include_rts = True)
# save most recent tweets
alltweets.extend(new_tweets)
outtweets = [tweet.text.encode("utf-8") for tweet in alltweets]
print(outtweets)
import requests
cookies = {
'popshow-temp-id': 'ss3iz6y2hwgs1g3mwkgp9q',
}
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:70.0) Gecko/20100101 Firefox/70.0',
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'en-US,en;q=0.5',
'Content-Type': 'application/json;charset=utf-8',
'Origin': 'https://onyolo.com',
'Connection': 'keep-alive',
'Referer': yoloURL,
}
data = '{"text":"'+initialMsg+'","cookie":"ss3iz6y2hwgs1g3mwkgp9q","wording":"Send me honest messages"}'
response = requests.post('https://onyolo.com/'+yoloUserCode+'/message', headers=headers, cookies=cookies, data=data)
print(len(outtweets))
for t in outtweets:
tweett=t.decode('utf-8')
data = '{"text":"'+tweett+'","cookie":"ss'
data += str(random.randrange(1,9))
data += 'in'
data += str(random.randrange(1,9))
data += 'y2hwgs1g3mwkgp9q","wording":"Send me honest messages"}'
try:
pass
#response = requests.post('https://onyolo.com/'+yoloUserCode+'/message', headers=headers, cookies=cookies, data=data)
except:
pass