Classic FM Last.FM Scrobbler
I recently decided I wanted to learn more about Web Scraping and so I set about finding a 'project' to complete. I've been an avid user of LastFM since 2006 and I scrobble almost all of my music I listen to... except when I listen to the radio.
I noticed that the currently playing track is listed on the top of Classic FM's website and realised I could write some python code to scrape this, and scrobble it to Last.FM. I also think this will work for other Global network stations as they seem to use the same HTML for their now playing widgets too. (Heart, Capital, etc)

Over the course of the next few hours, I threw together some rought code that extracts the track name and artist, cleans up the text and sends it on its way to last.FM. I've also added a function that checks if the last song we scrobbled is the same as the current song to avoid duplicates, and implemented a pretty progress bar using a snazzy library too.

Todo
Next up I'd like to enhance the tool so that it can take a timeframe, and scrobble the tracks played within that range (as the timestamps for each played track are published) so the script doesn't have to be ran live.
To respond on your own website, write a post which contains a link to this post - then enter the URl of your page here. Learn more about WebMentions.