What it does
PoliBot scans replies within a post in a subreddit and converts certain keywords into more "intelligent" words/phrases and replies to the comment with its own version of the reply. It is activated when someone types "!polibot" to summon it as a reply to the main reply.
How We built it
PoliBot was built via Python and the Reddit API, "praw" library. With importing its library, we were able to scan Reddit's streams and find specific keywords in a specifically user-defined subreddit title. After scanning and finding the keyphrase, "!polibot", it then proceeds to grab the input of the parent reply and converts the keywords found. It then uses the reply function to send a reply with the new text that includes all of the conversion.
Challenges we ran into
PoliBot was initially very difficult to start on. As we had very little python experience, we had to rely much on our C++ experience that we learned in the past half-year. We had to learn a new program as well as a library that interacted with an online site, which seemed daunting to us. There were many bugs throughout and the syntax of the conversions sometimes don't translate correctly. We're also limited to single keywords instead of sentences or phrases that someone may write.
Accomplishments that we're proud of
Overall, we're very proud of actually having a functioning bot that does mostly what it's programmed to do. With many documentation and tutorials, we were able to piece together a bot that interacts with a Reddit API which is amazing to us. We were also able to learn much more Python as well as distinguish which comments are the parent or if its a children of a parent.
What we learned
We learned many things including much of the basics of the Python language as well as the praw library that the Reddit API uses. We learned how authentication is a much needed factor in order to use API on live sites, but also discovered how awesome API's are.
What's next for PoliBot
As for the future of PoliBot, we may upload it to a hosting site to keep it running cloud-based, but only if we're able to debug it and improve it further. As for those things, we hope to figure out how to recognize phrases, and not just words, and also to improve our word list and its substitutions into an even bigger pool.
Try It out