Donate Bitcoins
What changes do you want to see?
Admin Password
    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
import time
import praw
user_id = "Summoner bot by goatgoose1142"
r = praw.Reddit(user_id)
r.login('Summoner_Bot', '--account_password--')
print('"' + user_id + '" logged in')
submission = r.get_submission(submission_id='11v36o')
comments = praw.helpers.flatten_tree(submission.comments_flat)
while True:
for comment in comments:
replied_comments_file = open("replied_comments.txt", "r")
already_done = replied_comments_file.readlines()
replied_comments_file.close()
print("------------------------------")
print("checking comment:")
print("")
print(comment.body)
print("")
test_string1 = "--first string to find--"
test_string2 = "--second string to find--"
if test_string1 in comment.body or test_string2 in comment.body:
if test_string1 in comment.body:
print("LOG: " + test_string1 + " is in comment body")
if test_string2 in comment.body:
print("LOG: " + test_string2 +" is in comment body")
if comment.id not in already_done:
print("LOG: comment has not been responded to")
comment.reply("test reply comment id: " + comment.id)
replied_comments_file = open("replied_comments.txt", "a")
replied_comments_file.write(comment.id)
replied_comments_file.close()
comments_file = open("comments.txt", "a")
comments_file.write(comment.body)
comments_file.write("------------------------")
comments_file.close()
print("LOG: replied to comment")
print("LOG: continuing to next comment")
else:
print("LOG: comment has already been responded to")
print("LOG: continuing to next comment")
else:
print("LOG: selected text not found in comment")
print("LOG: continuing to next comment")
print("------------------------------")
#time.sleep(600)
break
View count: 139

Enjoy the site? All donations are appreciated. Paypal or BTC

Donate Bitcoins
Free Text Host is brought to you by Dagon Design
This site contains no adware, spyware, or popups
Questions? Comments?     Privacy Policy     Report abuse here