since 1998

personal website: joe crawford. code. occasional comics. toy robots. bodysurfing. san diego. california. say hi.

Finding earworms in last.fm data with PHP

Over the weekend I was prompted to think about the idea of an “earworm” — a song or piece of music that gets stuck in your mind. Some people find such “earworms” to be highly irritating. The idiom implies an actual worm in your actual ear which sounds positively *horrifying* to me. For me, an earworm can be pleasant. It can serve like a mantra, or a soundtrack that can help put me in a state of flow that leads to getting a task done. It can actually help productivity. And so I was curious, given that I have been sending listening data to last.fm (sometimes called audioscrobbler) for many years I took some time to write code to find sequential repetitions of music plays. And I found a bunch of them! “Little Fluffy Clouds” on repeat was because I made a single track playlist and accidentally left it running over a weekend, but otherwise it was fun to see the results emerge. I used PHP as it is the language I can quickly solve novel problems with. I love going from idea to a reasonable result in a matter of an hour or so. Also, I’ve put the code up on Github.

I’ve made a YouTube playlist with a number of the earworm tracks.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.