Behind the Tweets of 365 Revo Songs

A year ago I celebrated Sound Horizon’s 20th anniversary with a brief blog post where I advertised my Twitter bot and said I might talk about my technical problems with it “in another blog post”. Well, one year later, this is that blog post. 

Before I get into the behind the scenes (behind the tweets?) stuff, though, I’d like to say that I’m honestly just happy I was able to pull off this project. It never gained much traction even in this small fandom, but it was something and I learned a lot from the experience. 

Alright then, let’s go back to the very beginning. 

I think I got the idea for a Twitter bot that’d tweet daily Revo songs at some point during the summer of last year, can’t remember when exactly. Eventually I decided to make it an anniversary celebration project. On October 1st I tweeted about it and got Guren to help out and give feedback on how I was matching songs and days. I created the bot account at some point before the 23rd. Dealing with Xitter’s API and its authentication as well as getting the actual bot code to work at all took a while but was actually the easiest part. 

My original idea was to make use of the web server that hosts erufailon4.net and that I pay for, and have the bot be running on it. They have a console on their dashboard that I can use to run stuff, how convenient. Anyway, I immediately ran into issues with Python dependencies, though those were trivial to fix by just uploading the libraries along with my code. Once those were dealt with, I actually had it running and tweeting! The “hello world” tweet went up at 5:42 PM on October 23rd. It’s a good thing I decided to start testing well in advance, because next day I realized the bot was not staying alive. 

See, when I run a program in the dashboard’s console, it can only keep running as long as I’m connected to the dashboard. If the connection dies, either because I closed the browser tab or my internet disconnected, I’m logged out and the process is killed. 

I had no choice but to rethink my strategy. I didn’t initially want to host the bot on my laptop, because then it’d be unable to tweet while my wi-fi is not on (I always shut down wi-fi for the night because the light is too bright) and would be set to my daily routine instead of a constant timing every day. Oh, and I’d also have to manually restart the bot every time I restart my laptop. But in the end I couldn’t think of a better strategy. 

On the day of the anniversary, October 27th, 2024, the bot was opened publicly and it started its 365-day run. At that point I didn’t have all 365 songs decided yet - a large portion, yes, but there were still plenty of gaps that I had to fill with game OSTs. I admit I procrastinated a lot and didn’t start making decisions until the last moment. The last couple of weeks of the run in this year’s October weren’t decided until a month ago on September 28th. 

Overall I’m pretty satisfied. I learned a lot about APIs, authentication, and how much effort I’m willing to invest in a thing that only me and a couple of other people care about. The bot’s code is available on GitHub Gist. It’s about as messy as you’d expect from me. I might dump the song data and the logs somewhere just as a keepsake, it’s a lot of repetitive text so it compresses well (2.5 MB to just 350 KB). 

Well then, happy 21st anniversary to Sound Horizon and I’ll hopefully do something new for an unspecified anniversary in the Near Future. (No promises.) 

Comments

Popular posts from this blog

Ranking of OPs & EDs 2022

It's Time for Me to Touch Grass

Top 10 OPs and EDs of 2024