Skip to content

papernotes/Reddit-OriginalPostSearcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reddit Original Post Searcher Bot

OriginalPostSearcher
A Reddit bot that aims to comment with the original submission of an xpost

Made as a practice bot with Python for Reddit using PRAW. I wanted to make something for fun to learn a bit more about Python and databases.
Thanks to stackoverflow, /r/learnpython, and /r/python

~About 7k Karma in 1 Month :D

The format for a response is:

Original post referenced from /r/subreddit by /u/user
*submission title with link*

FAQ

What's the purpose of this bot?
The bot's purpose is to provide a sort of convenience and sourcing tool for x-posts that occur daily on Reddit. With this bot's comments, the referenced post in an x-post and its author is credited. It also helps save a few clicks, especially for mobile users.

Isn't this useless if there's the "other discussions" tab?
I actually did not realize that there was an "other discussions" tab until it was pointed out when this bot was commenting. At that point, I thought that there was actually no point for this bot due to that tab. However, I had a lot of positive reception (see below) and there was the benefit of providing a quick link for mobile users. With that, I decided to continue development of the bot, saving Redditors a few clicks and providing proper crediting.

How does it work?
Generally speaking, the bot looks to find any submission with that might be an x-post, tries to see if it can find the original submission in the subreddit mentioned in the title e.g. Title of post! (xpost from /r/specific_subreddit), and comments to the x-post the title of original submission, the author of that submission, its subreddit, and a link to the original submission. The bot is hosted on Heroku.

How does the bot search for the original post?
I, funnily enough, ended up using the "other discussions", along with several other tiers of searching with PRAW for the bot's code.
First, the bot checks the user's previous history, and if that fails, the bot checks the "other discussions" tab. If that fails as well, the bot will look through the referenced subreddit in the title of the x-post and search through the Hot and New tabs of the subreddit. By that time, the bot will hopefully find the post and comment.

What if the x-post author provided the source in the comments already?
The bot has a check just for that! If it doesn't find a possible source in the comments, the bot will go through the process of searching for the original post. By that time, however, the author may have provided the source as well.

What about brigading for subreddits that require "np" links?
There is a list of subreddits that the bot provides "np" links - nopart.py
There is also a list of subreddits that the bot will not comment to - ignoredSubs.py

Can I provide a suggestion?
Of course! PM /u/OriginalPostSearcher, and I'll be happy to look into it.

Reception

Positive

This is my new favourite bot! - Kvothealar
I like this bot. Whoever came up with it did good. - CaseH1984
Keep up the good work - Xfactor5492
THE SECOND COMING OF REPOST STATISTICS?! THE PRODIGAL SON HAS RETURNED! - StaticDraco
At least the bot gave me credit for my photo :) - FoodandFrenchies
I fucking love the bots in this sub. There's a sentence I never thought I'd see myself type. - Takatalvi_Ignatio
Thank you bot. What would we do without you. - LordZikarno
I'd recommend not banning that bot, he's quite useful. - Chastlily
This bot is awesome - Ninja_Fox_
I appreciate that. - FaceReaityBot
thank mr bot for good xposts and lack of calcium - Poyoarya
Thank you for tagging me botfriend <3 - throwcap
Ooh, that's a cool bot. - Non-Alignment
Wow, what a useful bot I never knew existed :O - mnmnmnmn1
Ahh you beat me to it. Excellent bot, this. - critically_damped
I think this bot addresses every possible problem with reposting. - winter_mutant
Well that is a nifty bot. - davidverner
Hey, I kind of like this. Kudos bot. - NewJerseyFreakshow
What a lovely bot. - kevik72
See, the bot knows how to crosspost. Why can't we all? - Duke_Wintermaul
Woah, that's super helpful. I've never seen the x-post bot work like this. - jimmycthatsme

Not so positive

I hate this bot. - MightyDebo
Please die mr bot - Lurkerphile
Is this bot really necessary? Can't people just click "other discussions" to see this? - send-me-to-hell
Yeah, we know how to use "other discussions" tab. - nakilon

And many "you have been banned from posting to /r/______"

Favorite Thread - Googling Recursion

Milestones

  • 30k Karma (2/12/2016)
  • 40k Karma (5/12/2016)

TODO

  • Do something to deal with unwanted comments (Completed 7/15/2015)
  • Continue to update/optimize bot
  • Continue to update the list of ignored and no-participation subreddits
  • Code refactoring could probably be done (It's quite messy at the moment) (OOP Design Completed 10/15/2015)

Updates

1.0.1 (7/15/2015)  -  Fixed commenting bug that involved the wrong links and added ability to delete unwanted comments  
1.0.2 (7/16/2015)  -  Fixed a string checking bug for utf-8 and added logging/print statements  
1.0.3                 Updated the order of finding the original post, check for content first
1.0.4 (7/17/2015)  -  Changed the return value of one of the variables, added more logging, updated ignoredSubs list/function names
1.0.5 (7/18/2015)  -  Added source check, renamed old user_agent from old files, and updated ignoredSubs list
1.0.6                 Updated source checking, updated user_agent, removed searchedPosts.txt, and updated ignoredSubs list
1.0.7 (7/19/2015)  -  Added check if getting subreddit failed, changed comment style, and updated ignoredSubs list
1.0.8 (7/20/2015)  -  Changed commenting style/words, updated ignoredSubs list
1.0.9              -  Code cleanup, updated ignoredSubs list
1.1.0 (7/21/2015)  -  Added new function to find the original post faster (doesn't cover self-posts), updated ignoredSubs list
1.1.1              -  Cleaned up code, updated ignoredSubs list
1.1.2 (7/22/2015)  -  Added original poster's username for commenting
1.1.3 (7/25/2015)  -  Fixed checking original post bug that involved "in" phrase, updated commenting to emphasize convenience for
                      mobile users, and updated ignoredSubs list
1.1.4 (7/29/2015)  -  Added ability to create no participation links for certain subreddits
1.1.5 (7/30/2015)  -  Added ability to look through poster's previous posts to save time searching
1.1.6 (8/05/2015)  -  Changed commenting to include link to Github repo
1.1.7 (8/13/2015)  -  Added ability to search specifically for xposts to save time going through non-xposts
1.1.8 (8/30/2015)  -  Added check to make sure content is as work safe as possible
1.1.9 (9/18/2015)  -  Added secondary check to make sure no source comments are found after setting up comment
1.2.0 (10/15/2015) -  Major code refactoring. Bot is now object-oriented. Also slightly faster than previous versions.
1.2.1 (11/12/2015) -  Added check to see make sure link isn't from the same subreddit. Small fix for finding original subreddit name
1.2.2 (3/4/2016)   -  Fixed bug in not deleting negative comments regularly
1.2.3 (6/4/2016)   -  Added check for when the original submission's title references the xpost's title
2.0.0 (10/28/2016) -  Adopted SemVer and change links to other subreddits to be np links

About

OriginalPostSearcher Bot for Reddit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages