I was thinking of writing this post months ago, ever since the infamous post by Heroku announcing the end of their free-tier plan, but a severe combination of the workplace’s busyness and homebound procrastination between September and November prevented me from doing so. Of course, I could blame nobody because of it. Now, with me finally returning from my vacation (gonna dedicate a full blog post about it later I think), and things cooling down at work (it actually isn’t, but things are much more ordered now with the arrival of new engineers–again, gonna dedicate a post for it later), I finally got the time to end my Heroku apps, migrate most of them, and of course, write this post.
Inspired by several other similar existing projects, I began making my weekend project last Saturday and kinda accomplished it on Sunday afternoon. Why did I do this, by the way? Well although I’ve been using Python’s Streamlit and Heroku for a while at work, I have never used them for any of my personal projects—not that I’ve had any personal projects ever since I started my new job anyway, but, well—
So the idea of the word cloud is pretty simple: you make a cloud of words, based on a text, where the words that appear most would have a bigger size. In the case of my web app, it will extract the tweets from a certain user (we can choose any user, simply input their username, and as long as their profile is open and public, you’ll be able to scrape their tweets), get all the words they’ve used, and make a word cloud from them. That’s it.
In the beginning, I thought of copying the others and making some kind of “Your 2021 Twitter Highlights”, but in the end, I decided to make the app work in two modes: either by inputting the number of last tweets that you want to extract (max. 2000 tweets) or extracting the dates within one interval (by default, starts from today until a year ago, max. interval one year, and max. 2000 tweets). You might be asking, why only 2000 tweets? Well, I don’t want my app to be blocked by Twitter, that’s the first thing, the second is I’m running my app on the free version of Heroku, so limiting the processing time and power is kinda necessary for me.
Anyway, above is a short demo on using the app on mobile, and here are two examples of the word clouds that I have generated based on these two users’ last 1000 tweets: