Inspiration

This idea came from a user suggestion on r/modnews. But I've decided to take it beyond that user's original suggestion.

What it does

The app has a few main features that can be configured independently:

  • Adds an informational comment on posts/comments with information about YouTube videos (video title, channel name, publish date and runtime). If more than one YT link is present, the comment will report on all of them. You can also optionally choose to show the view count, channel subscriber count and video description.
  • Removes or filters posts/comments containing YouTube links from channels that are either too large or too small. A subreddit for new YouTuber self-promo might choose to remove videos from larger channels, but I expect that most subs will use it to filter comments from tiny channels.
  • Removes or filters posts/comments containing YouTube links with videos that are too long or too short. This might be useful for subreddits that prioritise either long or short form content
  • Removes of filters posts/comments containing YouTube links with configurable hashtags in their titles or descriptions

Example info comment

The app has been written to be incredibly easy to use and highly focussed on the simple task at hand. The default config will work for many subreddits (add info comment on posts only), and there is no complicated setup required otherwise.

Users do not have to submit their own API key as the YouTube API allows 10,000 operations per day, and so I'm expecting that this will be enough for

How we built it

I used a bespoke Devvit Web template that I use for my more recent mod apps, focussing on server only and using Hono. I'm calling the YouTube Video API to get information about videos and channels, caching the information in Redis.

I made reasonably comprehensive use of AI to accelerate development, including building out the YouTube API calls and full test suite, but the bulk of the important code was written by hand with some Copilot autocompletion involved.

I made the app simple to config - the default configuration is enough for any subreddit who wants to use informational comments, and all settings have validators where it would be of benefit.

Challenges we ran into

I've run into a Devvit bug that means that when filtering content, the reason passed in to the filter() method isn't shown in the mod log. This is annoying but not a dealbreaker.

I did forget briefly to ignore comments made by the app account which did lead to a 120-deep comment chain. I fixed that pretty quickly!

Accomplishments that we're proud of

I took this project from an empty template to a working version in around 5 hours total, with zero prior knowledge of the YouTube API. I'm particularly proud of this.

What's next for Youtube Info App

  • Move to Global Redis for caches if possible. I have already requested access to this.
  • Add a convenient way to block certain videos or certain channels on subreddits. I'll do this once it's possible to launch mod-only webviews from menus to manage this, I don't want a janky solution using removed posts

Built With

Share this project:

Updates