Skip to content

martijnboers/BlotterTrax

Repository files navigation

BlotterTrax

Reddit bot that uses streaming services to enforce popularity limits on new subreddit submissions, see in action.

Motivation

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.

Build status

Python application

Built with

  1. PRAW
  2. PyLast

Installation

  1. Copy the config example to config.ini cp conf/config.ini.dist conf/config.ini
  2. Create API account on Reddit, Last.fm, YouTube and SoundCloud
  3. Fill in the keys and passwords in the config/config.ini file
  4. Set REMOVE_SUBMISSIONS to true if you want to remove exceeding submission, otherwise it will create a rapport
  5. Set SEND_ARTIST_REPLY if you want the bot to reply with a last.fm artist bio
  6. Use Docker to build the image docker build -t blottertrax .
  7. Create a docker volume for the database docker volume create blottertrax
  8. 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

How to use?

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

Development

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)

Features

  • 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

Contribute

If you have features or bugfixes don't be shy to create a pull requests or bug report!

Credits

Thanks to:

License

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