Skip to content
rewrite of reddit bot for adding submission title to linked image
Branch: master
Clone or download
Pull request Compare This branch is 68 commits ahead, 1 commit behind gerenook:master.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
logs Create latest.log Apr 21, 2019
LICENSE Create LICENSE Apr 22, 2019
README.md Add an author tag option, Update comments, Update README Apr 12, 2019
bot.py Show logging lvl in CLI, add freefolk meme Jun 12, 2019
config.ini Added a ton of features, fixed up a ton of things. Apr 8, 2019
messages.py
parsed.txt Consolidate useless file, version control, namespace fixes Dec 29, 2018
roboto-emoji.ttf Add Emoji Support Dec 28, 2018
roboto.ttf Add files via upload Dec 25, 2018

README.md

Title2ImageBot

Rewrite of original bot by gerenook

Features

Standard Parsing:

Tag the bot in a post with /u/Title2ImageBot. The bot will automatically respond within 30 seconds with the post's title included in the image.

Custom Titles:

Include a custom title in quotes like so:

/u/Title2ImageBot "custom title goes here"

The bot will include the post with the custom title, and still allow users to use other custom titles or the original

Custom Arguments:

Custom arguments can be used like so:

/u/Title2ImageBot "custom title still goes here if needed" !center !dark

!c, !center, !middle will center the text at the top of the image

!d, !dark will invert the title section (white text on black)

!a, !author, !tagauth, !tagauthor will include the submitter's username in the image.

It appears dark mode was an intended feature at some point in the original bot, so thanks to gerenook for some of the code required to make it work

PM parsing:

Bot can be used via PM if its banned in a sub (lots of subs thanks to /r/BotBust banning me twice)

PM a link to a submission. Subject should be "parse"

Running the bot

(Please dont try to run another bot unless /u/Title2ImageBot is shut down for good. Running it on your own sub is fine, but if you want DM me and I can set this one to automatically run on your sub)

Depends:

Praw
Pillow
PyImgur
GfyPy
ImgurPython
argparse

usage: bot.py [-h] [-d] [-l] limit interval

Bot To Add Titles To Images

positional arguments:
  limit        amount of submissions/messages to process each cycle
  interval     time (in seconds) to wait between cycles

optional arguments:
  -h, --help   show this help message and exit
  -d, --debug  Enable Debug Logging
  -l, --loop   Enable Looping Function

TODO:

Fix Gif framerate issues

Credits

/u/gerenook for original bot's code, most of the RedditImage class is his work.

Roboto-Emoji is a custom font I created in FontForge that adds support for emojis.
Feel free to use it.

GfyPy is a gfycat python api I wrote with extremely basic support for what i needed. It's on my pinned repositories tab. Feel free to contribute as it's currently the only gfycat python api with auth support

You can’t perform that action at this time.