Inspiration

2020 was the year we all had to fight alone in some shape or form. In conjunction with the outbreak of the coronavirus, it has forced everyone to stay home and avoid loved ones and friends. There has been a surge in cases of depression and anxiety that comes with self-isolation. Isolation can be detrimental to some people and the negativity created can lead to pessimistic ideals and values. People flock to social media to express their feelings, yet there never seems to be enough people that ask if they are okay or if they need help. Positivity can be life-changing in some people's lives, so that's what we wanted to achieve with this project. We wanted to make sure that people receive likes to gain exposure to seek help. Even if it just a little heart icon on their post, it can restore hope that someone out there cares for them or is watching them and giving them attention. I remember all the countless times when making a tweet and no one likes it and feeling empty afterward. Sure, social media can be addicting and detrimental to mental health, but with our bot, we can expose people to positivity on our feed/page; and if they need it, the bot can help the user seek help through hotlines and links through various help-line websites.

What it does

Currently, the bot is able to like posts based on user's keywords in their tweet. For example, the bot may look for "I need help" or "I am sad" and it'll search the most recent tweets with these keywords and like them. We have the bot set up so every 30 minutes, it'll like one tweet with a random set of keywords given through an imported .txt file. Every 2 hours, the bot will populate its' feed with a motivational quote or saying or link to a hotline/website (Work in progress) and like its' own tweet. The intention of this bot is to gain traction by spreading awareness of the bot (by liking) and other people's tweets to act as a gateway to help people find a form of help through resources or positivity.

How we built it

Our program utilizes the tweepy libraries to use certain commands to help tweet out and like other people's tweets. The Positive Bot's whole existence lives and breathes on the tweepy library. Each function is defined, and each function has a certain interval at which it will do the function. We currently use a sleep function and that is set to 30 minutes every like, and every 2 hours is a tweet will be tweeted. All of our functions will be run under the main declaration, where this will run forever until it is turned off by the user using an exit.

Challenges we ran into

Right off the bat, we had no idea what we were doing with APIs. We had one goal in mind and that was to create a Twitter bot that could interact with the platform. Along the way, we experimented with foreign functions and imported libraries such as tweepy. It proved to be a challenge utilizing new functions, but it was fun to explore and mold it into a working object. Our first obstacle was being able to time the tweets and giving out likes (to give the bot and people's tweets exposure) at certain intervals. We were able to format the intervals at 4 likes to 1 tweet ratio.

Accomplishments that we're proud of

We have already gained a bit of following while running the bot for less than a few hours now. We did not expect to get any traction or interest in our bot, let alone somebody liking our bot-written tweets.

What we learned

APIs in general are very powerful. It was both our first time using APIs and we saw the true power and capabilities as we were experimenting. We were both blown away by how readily-accessible data was through Twitter's developer APIs, and we plan to continue to explore more ways to use APIs in future projects.

What's next for The Positive Bot

In the future, we can expect this bot to gain a following if we continue to run it more often. The Positive Bot still has a lot of things to become the bot we want it to be. We plan on adding a way to sweep the web for motivational and uplifting quotes instead of handpicking quotes and loading them manually in a text file. We also want the Positive Bot to be able to reply to people who mention or reply to the bot-created tweets. Though we ran out of time to implement these key features, the Positive Bot will become more advanced and interact with its users through these implementations.

Built With

Share this project:

Updates