r/Defranco Reddit Bot
Date
2017 - 2019
Technology
- Node.JS
- Express
- PHP 7.2
- Docker
- PostgreSQL
Description
In 2017 I was a contributor of the r/Defranco subreddit for the news content creator Philip Defranco. I noticed that the subreddit had a recurring issue with members posting the same video in a short period of time (leading to multiple posts) or not posting it at all.
I decided to make a bot to automatically retrieve the latest video from Philip Defranco's YouTube channel and post it to the subreddit. The bot was written in PHP 7.2 and ran on a Docker container on a VPS. The bot was designed to run every minute and would only post if the video was not already posted. The bot was promoted to moderator by the subreddit staff and I extended the bot to make and rotate sticky posts as needed.
Eventually I ran into an issue where the YouTube API would be updated less frequently than was ideal. Other members would post videos instead, causing the same issue as before the bot was made. To fix this issue I decided to move away from the YouTube API. I scraped the Twitter and YouTube HTML to determine when a new YouTube link was posted and used that to determine when to post to the subreddit. This changed reduced the time between the video being posted and the bot posting it to the subreddit from 5-15 minutes to a minute at most. The API integration was kept as a failsafe.
The bot was retired in 2019 due to repeated changes made by YouTube/Twitter that broke the bot. I originally intended to release the functionality as a FOSS project, but it was put on hold indefinitely.