Programming Outside Work: Lockdown Edition

Baba
7 min readFeb 6, 2021

One of my goals this year is to write more publicly. In particular, I aim to publish a piece on “technical stuff” every month so this is my attempt for January. Last year, I had a different goal: to start some more computing side projects. That has technically always been one of my goals every year since I started working as a Software Engineer and helped partly by the pandemic lockdowns and with nothing better to do I was actually able to achieve that last year. This post was initially meant to be about two of them in particular but I think I will save that for the next post and just talk more generally about all the ones I did last year.

Spotweefy V1

The Original Verzuz

This was my first project and combining two things I love Spotify and Twitter, I made a bot that could create a chart comparison of two artists using data about their songs. Not sure but think this was also during the first iteration of the Verzuz battles. Was disappointed to find that most artists are very similar, not Hans Zimmer and MHD though

Top Of My Spotify

This was a website I made using React to brush up my web development. The backend was in Python which I hadn’t touched in 2 years. The idea was to just fetch a user’s top tracks and artists from Spotify and display it like those #SpotifyWrapped playlists. I also added a recommendation functionality (could be better to be honest, it recommends songs people have already listened to) to get recommendations based off the top tracks. Pretty simple but just wanted to shake off my Python and Javascript rust

Let me put you on some songs

I thought it would be fairly popular because of #SpotifyWrapped playlists but that really wasn’t the case but there were unexpected spikes on the dashboard which showed some random people did use it, which made me pretty chuffed! I mean look at that chart, who doesn’t love metrics. It ain’t much but its honest work

Months after “Launch”. Should have tracked who was using it but didn’t want to store any user data

This was also my first publicly hosted website. It iss one thing to run one thing from your computer and it is another to run it publicly so other people can use it. The decision of where to host it was a bit difficult, I really wanted to do AWS so I could learn a bit more about deploying stuff on there through hands-on experience. In the end I settled on Heroku because of the free dynos I got and the ease of deployment. Only problem is that free ain’t free. The dynos don’t stay running 24/7 so random users that want to visit the site may be met by a very slow website if the dynos are asleep as it takes some time for them to get up and running and serve the website again.

Twitter DM Exporter

Wonder how much bounty that is worth now

I did this because I saw a bounty from Balajis on Twitter (cool guy to follower on Twitter for Tech stuff, loves his bitcoin/decentralisation, he used to follow me for some reason before I realised he was a big deal *Druski Meme*. No idea why but he doesn’t any more). Anyways I thought it was a pretty simple challenge for the bounty being offered so I coded something up quickly to confirm my assumptions and it was easy. I didn’t submit my solution though I was able to see others solutions and a lot of them were pretty similar. Saw some really good ones that covered a lot more edge cases than I did, some with bettern user interfaces and some already productionised but overall my solution was adequate and my approach was right! Felt good to see people with more experience than me taking similar approaches

Spotweefy V2

The first iteration (V1) of the bot only worked if people send it a specific string format to plot the chart but only one person ever used it loool. Shout out Michael. So I decided I wanted a bot that real humans would interact with so I decided to take the backend Python server for my website and repurpose it to tweet my top artists, top tracks, tracks I liked, tracks I’m listening to and new releases.

Shoutout to AYLØ

This runs locally on my laptop. I initially designed it in a way that other users could use it but for it to constantly run I would need a persistent data store for the access tokens I would need for OAuth to access the APIs, so decided to limit it to just me and run locally.

It was very extensible and I easily added a feature that tweeted songs about the state of Nigeria (shameless plug check out this playlist) during the peak of the #EndSARS protests to add to the trend, it is still running now but pretty much all its interactions are from other bots. In fact most of the interactions with this bot are from bots, stans and fans (the initially title of this post but now the title of the next post). Just seen the bot has clocked over 10,000 tweets now

Find A Reaction

So I spend way more time on Twitter than I probably should but the jokes you get on there are just unmatched. One of the best parts about Twitter is using the appropriate image, GIF or video as the punchline. Images are easily found I think on Google, GIF keyboards are getting better but videos on Twitter? That was a different ball game. My usual strategy was to DM funny videos to myself and then go search my DMs for them when the time was right. However this way was suboptimal because 1. Twitter doesn’t let you search DMs 2. Even if it did, I wouldn’t know what to search for as the surrounding caption of the video would be unrelated to the actual video 3. The original tweet with video may be gone because it was deleted or the original tweeter has gone private or left Twitter

Stats since I created the bot (again metrics for the win)

So I came up with the brilliant idea of providing a place where people looking for the right reaction videos could search Twitter for it to find it. After I thought of the idea I saw that there were already some accounts doing the exact same thing. Thing is those accounts didn’t really have the videos I would be looking for so decided to forge ahead and create mine. Also those accounts created and uploaded original content, I didn’t plan on doing the same because of time. I just wanted to taken my current approach and codify it, so I created a bot that I would DM videos to with a description of the videos and the bot would download the video and reupload it (in case the original tweet was ever deleted) and would tweet it with a description so that I, or indeed anyone, could search for a video and find it.

Now the plan was to let anyone DM the bot videos with descriptions, but in hindsight that would have been risky but I could have banned certain words. In any case, the twitter API does not allow you read DMs from people you don’t follow. One way round that was to program the bot to follow back every one but thought otherwise and just made the bot follow me and other heavy video users I know and told them to test it out. In the future, when I eventually get round to learning Machine Learning maybe I’ll add something to give descriptions for the videos so I don’t have to. I still think ML is a long way away from that (take that GPT-3). Turns out Twitter Search doesn’t return results for all the tweets ever tweets so the idea was a bit flawed as sometimes when you search you are not able to find the videos.

Calling them my videos is a definitely a reach loool

This bot has been pretty successful in my opinion. I have done literally zero promotion of it and it has seen organic growth in 3 months to over 800 followers, and look at the views the videos have gotten in that time! Think even if I killed the bot, it would still continue to attract followers and views, offered it to Zikoko to run but not sure they saw my tweet. One of my fave past times now is seeing how people are using the videos, memes are truly universal. Stan Twitter and Sports Twitter are by far the biggest users! Really want to write about my findings, in the next post I think but nice to see something I created in one Saturday evening being used so widely. This is exactly the reason I wanted to learn to program, so I could randomly automate things away haha.

--

--