Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 8a2ebc0

Browse files
author
PokestarFan
committed
More changes
1 parent 9311faf commit 8a2ebc0

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Diff for: delete.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99

1010
def main():
1111
try:
12-
for item in reddit.inbox.comment_replies(limit=30):
12+
for item in reddit.inbox.stream():
1313
logger.debug('On item {}'.format(str(item)))
14-
print(item.body)
1514
try:
1615
if 'delete' in item.body.lower():
17-
item.parent.delete()
18-
logging.info('Comment {} removed'.format(str(item.parent)))
16+
item.parent().delete()
17+
logging.info('Comment {} removed'.format(str(item.parent())))
1918
item.reply('The top level post has been removed.')
2019
except:
2120
logging.debug('Item {} skipped'.format(str(item)))

Diff for: duplicate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def action():
2828
if 'imagesof' not in str(dup_sub.subreddit).lower() and 'auto' not in str(dup_sub.subreddit).lower() and 'bot' not in str(dup_sub.author).lower() and 'mistyfront' not in str(dup_sub.subreddit).lower() and 'unitedfederation' not in str(dup_sub.subreddit).lower():
2929
time = dup_sub.created
3030
time = str(datetime.fromtimestamp(time))
31-
author = str(dup_sub.author)
31+
author = '/u/'+str(dup_sub.author)
3232
if str(submission.author) == author:
33-
author = author + '[author of both threads]'
33+
author = author + ' [author of both threads]'
3434
duplicates.append({'title':str(dup_sub.title), 'subreddit':str(dup_sub.subreddit), 'link':'https://www.reddit.com'+str(dup_sub.permalink), 'time':str(time), 'author':author, 'karma': str(dup_sub.score)})
3535
if len(duplicates) > 0:
3636
message = 'Here is a list of threads in other subreddits about the same content:\n'

Diff for: lowpostremover.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
logger = setup_logger('low_score_remover')
1717

1818
###########################
19-
# definitions
19+
# defistarnitions
2020
###########################
2121

2222
#defining the log in process
@@ -34,5 +34,7 @@ def action():
3434
if comment.score < setvalue: #if statement checking the comment score < 0
3535
comment.delete() #deleteing the comment if < 0
3636
logging.info('Removed comment {}'.format(str(comment)))
37-
38-
action()
37+
38+
while True:
39+
action()
40+
time.sleep(60)

0 commit comments

Comments
 (0)