Often when Richard Liang, my partner, and I have some free time to spare, we check Reddit to catch up on the latest news and memes. The issue with this is that what was originally intended to be an easy way to kill 5 minutes becomes a sinkhole for hours and hours of time. Since both of us regularly use google assistant, we wondered if we could use its smarts to entertain us for short periods of time.

What it does

Quick Reddit acts like a carrier between Reddit and the Google Assistant. Whenever the user wants to catch up with the latest trends, they will go ask the Assistant to do that for them. The Google Assistant will do so through Quick Reddit, delivering the 'hottest' post in a specific subreddit at the time the request is made.

How we built it

Quick Reddit is split into two parts -- one that interfaces with Reddit, and another that interfaces with the Google Assistant. We took advantage of Reddit's APIs and JSON tools which allowed us to accurately identify the subreddit that the user is talking about, as well as obtain information about the 'hottest' post in any given subreddit. To interface with the Google Assistant, we mainly used Actions by Google. This library, along with Firebase and Dialogflow, allows Quick Reddit to understand what kind of post the user wants to see. After determining the subreddit the user is interested in, Quick Reddit will find an appropriate post, extract the desired information from it, and send it to the user.

Challenges we ran into

Initially, we used Dialogeflow's libraries to connect Quick Reddit to the Google Assistant. This library allows integration with various services (like FB Messenger, Whatsapp, etc.), so it wasn't optimized for use with the Google Assistant. After switching over to the Actions by Google library, we were able to implement our product more easily. Figuring out how to use Reddit's rudimentary APIs was also a challenge, since we did not want to overload the user with information through the Google Assistant.

Accomplishments that we're proud of

We're proud of the response times and versatility of our app. In the beginning, we were designing Quick Reddit with only one subreddit in mind, but we realized that expanding to all subreddits is relatively simple, and that we didn't have to change much of our program's flow to do so.

What we learned

We learned how powerful the behind the scenes machine learning in Dialogflow was, allowing us to give a few training prompts to generalize many user requests. We also learned how complicated a seemingly simple project can get; you can't always rely on documentation 100%, and sometimes the errors that are returned don't describe the issue properly.

What's next for Quick Reddit

Quick Reddit can be improved to cover many more kinds of posts, like big text posts and video posts. We can also implement Reddit account linking, so that the user can save threads that he would like to get back to later, or upvote/downvote posts as they wish.

Built With

Share this project: