forked from spediso/RedditVoteBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredditvotebot.py
More file actions
47 lines (41 loc) · 1.39 KB
/
Copy pathredditvotebot.py
File metadata and controls
47 lines (41 loc) · 1.39 KB
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
#!/usr/bin/env python
#redditvotebot v1.2 by sped
import praw
x = 1
r = praw.Reddit('redditvotebot v1.2 by sped')
r.login()
input = raw_input('Enter the username of the target: ')
input2 = str(raw_input('Would you like to (U)pvote or (D)ownvote the target? (U|D). '))
input3 = str(raw_input('Would you like the bot to run continuously? (Y|N) '))
upvote = 'u' or 'U'
downvote = 'd' or 'D'
yes = 'y' or 'Y'
no = 'n' or 'N'
if input2 in downvote:
print('Begining to downvote. The permalink to the comment will be printed when a comment is downvoted.')
already_done = set()
user = r.get_redditor(input)
while True:
for comment in user.get_comments(limit=None):
if comment.id not in already_done:
comment.downvote()
already_done.add(comment.id)
print(comment.permalink)
if input3 in yes:
x +=1
if input3 in no:
exit()
if input2 in upvote:
print('Begining to upvote. The permalink to the comment will be printed when a comment is upvoted.')
already_done = set()
user = r.get_redditor(input)
while True:
for comment in user.get_comments(limit=None):
if comment.id not in already_done:
comment.upvote()
already_done.add(comment.id)
print(comment.permalink)
if input3 in yes:
x +=1
if input3 in no:
exit()