Inspiration

You go to the 'Trends for you' and tap a word to know why this topic is trending. But sometimes it's hard to know why it is trending. Every time you scroll the feed you found out every one talking about different thing about the topic. At that moment, you can use @whytrendingB0t to instantly know what people are talking about the topic.

What it does

Just mention @whyTrendingBot with a word or hashtag you're interested in. Then it will reply back with a tweet that represent what people are talking about the topic.

How we built it

Using Twitter API v2, it checks any original tweet mentioning it tweeted with a valid word or hashtag. If it does, my bot search up to 100 tweets including the word. Then by doing extract summary, it stores score for every sentences as value in a dictionary. Finally it return a tweet that includes a tweet containing a sentence with a highest score.

I cloned the Github repository to the vm instance created on Google Cloud Platform, and started running the program in tmux mode so it can reply back to any user's tweet 24/7.

Challenges we ran into

Extract summary itself was not good enough for calculating scores for each sentences. It considered a lengthy sentence talking about unrelated to trend as the one with the highest score. But I solved this problem by only adding score to the sentence if the frequency of the word is bigger than 1 while doing the extract summary.

Accomplishments that we're proud of

In a just few seconds my bot finds a tweet that represent what people are talking about the word user provided. So users don't need to scroll feeds many times to figure it out themselves.

What's next for Why Trending Bot

Supporting multiple languages Rather than showing an English tweet always, make the bot reply with a tweet written in the same language as the word the user used.

Share this project:

Updates