Reddit bot that uses streaming services to enforce popularity limits on new subreddit submissions, see in action.
This project started to decrease the amount of popular music shared on /r/listentothis and hereby encourage the sharing of undiscovered and underappreciated artists. This came to light after a post pointing out that recent top submissions are breaking the subreddit's rules.
- Copy the config example to config.ini
cp conf/config.ini.dist conf/config.ini
- Create API account on Reddit, Last.fm, YouTube and SoundCloud
- Fill in the keys and passwords in the
config/config.ini
file - Set
REMOVE_SUBMISSIONS
to true if you want to remove exceeding submission, otherwise it will create a rapport - Set
SEND_ARTIST_REPLY
if you want the bot to reply with a last.fm artist bio - Use Docker to build the image
docker build -t blottertrax .
- Create a docker volume for the database
docker volume create blottertrax
- Run the container with the volume attached
docker run --mount source=blottertrax,target=/usr/src/app/database blottertrax
And that's it! If it doesn't work you can create an issue
Please set the SUBREDDIT
in conf/config.ini
to select the desired subreddit to moderate. This only works when the Reddit account is moderator of the selected subreddit
As this bot is running 2 applications, handling new submissions and modmail it's run with multiprocessing.
To debug, in main.py
change the code for the application you want to debug. For example only testing mod mail:
lock = Lock()
# Process(target=ModMailDaemon().start, args=(lock,)).start()
# Process(target=SubmissionDaemon().start, args=(lock,)).start()
ModMailDaemon().start(lock)
- Using Youtube, Last.fm and Soundcloud for detecting submissions with exceeding listen count
- Report self-promotion posts using username and submission title
- Post artist tags, album information and social media links using Musicbrainz
If you have features or bugfixes don't be shy to create a pull requests or bug report!
Thanks to:
- Nedlinin
- TcMaX
- Electronic music duo BlotterTrax for the name
You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.
GPL © Martijn Boers