banner

Ruggero Bettinardi, PhD

Radio Lockdown: Audience tracking

After the Auto-Horoscopes, I realized it would have been interesting to track the number of current listeners of each episode of Radio Lockdown, so that we could have some objective feedback about the performance of the radio, while I could learn at the same time the basics of web scraping with python. 


In fact, we relied on IceCast2 for the stream of the webradio, and we could monitor the current number of listeners at any moment through accessing a particular URL. The main drawback was that this service didn’t allow us to get statistics about the number of listeners at a given time: and that is where I worked on!


Therefore I created a python script that used the BeautifulSoup package to scrape our dedicated IceCast2 URL every 15 seconds, storing the number of current listeners in an excel database that I handled with pandas. After that I applied a moving average smoothed over a 10 minutes interval so to get more meaningful results.