/dm_bot

A reddit PRAW bot that provides an imgur mirror of Daily Mail articles

Primary LanguagePython

dm_bot

This bot is more of a learning exercise than anything else, no harm intended.

It works by using phantom.js and selenium to grab a screenshot of the whole page and mark some points for reference. The next step is to crop just the article out of the page by using pillow, and then save it as a jpg to save bandwidth. Once it has done that it can post a comment on the reddit post with a link to the image.

Needs all this installed to work:

  • praw - get reddit posts and comment on them
  • selenium - get screenshot through phantom.js
  • pillow - crop screenshot to just the article
  • libjpeg8 - allows pillow to save as jpeg
  • phantom.js - renders the screenshot

A picture of the output

Link to /u/DailMail_Bot. See him in action!

I was originally using imgur, however imgur would compress images over 1MB so they were unreadable. I now use a.pomf.se as it allows for the full image to be shown.