-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
55 lines (48 loc) · 1.96 KB
/
main.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
import praw, sys, time
actions = 0
version = '1.01'
useragent = "predditor-" + version # user agent
# sockpuppet accounts [username, password, api_client_id, api_secret_id]
accounts = [
['username1', 'password1', 'api_client_id1', 'api_secret_id1'],
['username2', 'password2', 'api_client_id2', 'api_secret_id2'],
['username3', 'password3', 'api_client_id3', 'api_secret_id3']
]
targetuser = "city_of_edgerton" # the user to vote on
mode = "up" # [up] or [down] vote
thelimit = None # how many posts/comments to downvote (for unlimited, set to None)
interval = 1 # how long to wait before requests (in seconds)
for account in accounts:
reddit = praw.Reddit(
client_id=account[2],
client_secret=account[3],
user_agent=useragent,
username=account[0],
password=account[1]
)
# vote on posts
for submission in reddit.redditor(targetuser).submissions.new(limit=thelimit):
actions += 1
try:
if mode == 'down':
submission.downvote()
elif mode == 'up':
submission.upvote()
print("action " + str(actions) + ": " + mode + "voting " + targetuser + "'s post: " + submission.id +
" (" + str(submission.score) + ") with " + account[0])
except:
print('⚠ there was some problem voting on ' + submission.id)
time.sleep(interval)
# vote on comments
for submission in reddit.redditor(targetuser).comments.new(limit=thelimit):
actions += 1
try:
if mode == 'down':
submission.downvote()
elif mode == 'up':
submission.upvote()
print("action " + str(actions) + ": " + mode + "voting " + targetuser + "'s comment: " + submission.id +
" (" + str(submission.score) + ") with " + account[0])
except:
print('⚠ there was some problem voting on ' + submission.id)
time.sleep(interval)