SPOTIFY POPULARITY CATALYSTS
Scene from HBO's, The Last of Us, where Ronstadt's "Long Long Time" plays for the last time in the episode.
THE SPOILER WARNING
First, jump over to my About Evan page, then commit to memory my face, and finally imagine it crying on a Sunday night as I realized HBO's hit series, The Last of Us, weaponized Linda Ronstadt's Long Long Time track with sights on our vulnerable, messy hearts. That's all I'll spoil about it!
That night I started the V1 of my Spotify Popularity script, which I use to evaluate the impact that cultural moments have on our desire to stream music. The dashboard below analyzes the impact on popularity resulting from three main cultural catalysts:
-
Lift associated with a track's appearance in a show (the annual Kate Bush Award)
-
Lift associated with a track's appearance at the Super Bowl
-
Lift associated with an artist's passing.
THE CODE
Trying to capture holistic popularity growth, as well as at an individual track level, the script is tailored for Spotify's artist pages. While the popularity figures made available through Spotify's API were helpful, I used Selenium to navigate to each artist pages, interacts with buttons to load top ten songs (if applicable), and extract stream counts. That data was then inserted into a SQLite database.
Given the number of dynamic elements on the page, the time associated with scraping (and the problem of breaking the script mid-run), the biggest challenge was ensuring consistency with ignore statements. Attached to the right is the DB schema and some snippets of the code. I also pulled album, track-level, and playlist data from the Spotify API, but those yielded less results and therefore are not the focus of this debrief.
