Inspiration

With the pandemic still ongoing, we thought it would be interesting if we could do something with the information about activity restrictions on Brown campus. While we currently have not found an API to access such information, it would not be too difficult to extend our bot with a web scraper to accomplish said goal. For the time being, it instead pulls state-level Covid-19 data from a different API.

What it does

The bot is pointed at a specific subreddit (currently, reddit.com/r/test - but this can easily be configured to be another subreddit such as /r/BrownU), and will parse any new comments made on that subreddit for certain keywords. If it detects coronavirus-related keywords, it responds with a table of recent Covid-19 data for Rhode Island.

How we built it

We leveraged the Python Reddit API Wrapper (PRAW) open source library to handle all interactions with Reddit.com. On the other end, we have functionality for making basic HTTP requests for information to a Covid-19 data API at https://covidtracking.com.

Challenges we ran into

One initial challenge was that it was difficult to find a good source of Covid-19 data that is easily accessible via an API. We were unable to find an API source more specific to Brown University, so we had to settle for state-wide data for the time being. Also, as Reddit limits new accounts to 1 post per 15 minutes, our bot currently will miss some messages in that time frame. This problem will go away on its own once the account is more established, or can be handled with more sophisticated rate-limiting response mechanisms in future implementations of the bot.

Accomplishments that we're proud of

We are quite happy to have a working product in such a limited amount of time (we didn't even stay up that late!) and with just a two-person team. Although the bot has a lot more potential for improvement, we are very satisfied with this starting point.

What we learned

We learned the basics of making a Reddit bot, which is a skill that has a diverse array of useful applications, given that Reddit is such a major website.

What's next for Brown-U-Bot

We hope to find some source of data more specific to Brown University or Providence, so we can deploy our bot to serve our local community subreddits.

Built With

Share this project:

Updates