Skip to content

A bot for Reddit to help out Anteaters who want to switch into CS

License

Notifications You must be signed in to change notification settings

SirIsaacNeutron/UCI-CS-Helper-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UCI CS Helper Bot

This is a simple bot for Reddit that is meant to help out people at UCI. As I browse /r/UCI, I noticed that there are quite a few people who want to become Computer Science majors, but were accepted as Undeclared/Undecided, or as an non-CS, alternative major. So I got an idea to make this bot in order to help these people out.

The bot goes through a bunch of hot submissions in /r/UCI and checks their titles and their text with a regular expression. If the title or the text of the submission matches the regular expression, and if the bot does not see the submission's id in repliedto.txt, the bot will reply to the submission with a message.

Unfortuately, I was unable to get the bot to deal with comments. In its current state, the bot will respond to pretty much any message dealing with the topic of changing major to Computer Science, even if the message is not actually soliciting advice about how to get into the CS major. I thought of using some sort of NLP to help the bot deal with comments, but I know nothing about how to go about doing that, and I was in a rush to test this bot out in the real world. I was in such a rush because I was aware that it was a little bit late for my bot to help many people (as far as I am aware, most college acceptances were given out in March, not April, and that would have been the time people found out that they did not get in CS). Furthermore, I did not want to spend too long trying to learn NLP -- which is certainly a complicated subject -- only to have to test my bot out on posts and comments that are quite old. I already had to learn PRAW and I decided that it would be better to keep my bot simple for now, as this was my first bot for Reddit.

However, despite my bot's limitations, I am satisfied with it, and I am happy to show its source code to the world.

Usage

(For MacOS High Sierra.)

To get a help message showing how to use the bot:

python3 uci_cs_helper.py

To run the bot in debug mode (show which messages the bot would respond to if it were actually running, without responding to them):

python3 uci_cs_helper.py -d

or

python3 uci_cs_helper.py --debug

To actually run the bot (have the bot respond to submissions on Reddit):

python3 uci_cs_helper.py -r

or

python3 uci_cs_helper.py --run

Built With

  • PRAW -- "a python package that allows for simple access to Reddit's API."

I also found regex101.com to be quite useful for this project as well. regex101.com is a site that helps visualize how regular expressions are matched in text (if they are matched at all). I used it for one of my previous courses and it proved itself quite useful again here.

About

A bot for Reddit to help out Anteaters who want to switch into CS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages