I made a bot which fixes indirect imgur links

I hate the imgur comments page. I greatly prefer just viewing the direct image when I view a linked image on imgur. So I made this bot to fix the terrible load times and the unpleasant congested view of the image.

source

wiki

Posted May 14, 2016, 6:18 PM UTC

107
shaggoramaBot Creator•

Instead of just getting the last 100 comments/submissions, I think you should just store the IDs of the last comment and submission you've seen, and then in your next iteration go back as far as you can in new comments/submissions until you hit an id you recognize.

Also, I think your bot would be greatly simplified by using the praw.helpers comment_stream and submission_stream objects. This would provide you with a generator that wouldn't exit, so you'd have to run two separate bots: one for comments and one for submissions. I think it would still make your life a lot easier though.

If you haven't already seen it, you might find this tutorial helpful: https://praw.readthedocs.io/en/stable/pages/call_and_response_bot.html

2
_jho•

Will it run on all subs or only specific ones?

1
DirectImageLinkBotOP•

Anything it isn't banned from. When it gets a "you've been banned from r/XXX" message in its inbox it ignores that subreddit in future. Have a look at the source! :)

1
ImJustaBagofHammers•

So I could PM it "You've been banned from X" and it would stop posting there? Interesting... There should be a bot for that.

2
DirectImageLinkBotOP•

No. Initially you could but I fixed it recently.

3
ImJustaBagofHammers•

Good.

1
sunshine-x•

that

0