web-servicesshoutcastinternet-radio

Building a radio directory


I few years ago I wrote a radio player for iOS and Mac OS X. I want to update that app and one issue I'm facing is that most stations go offline after a certain time. This time I don't want to implement a local database of stations, but build my own online directory. I was wondering a pratical way of keeping track of which stations went offline and which ones are still working. There are some directories like SHOUTcast that are able to do it, but so far I was unable to figure out how they work. Any ideas of how to keep a working online radio directory?

TIA!


Solution

  • What I've done in the past is connect to the stream until the metadata block, then parse the metadata and disconnect. This typically only requires ~8KB of data per poll interval, and allows you to check the current playing media as well as reasonably assuring that the station is up and running. Then, you just have to decide what your polling interval is. Don't make it too frequent... most stations have very tight budgets for bandwidth and their operators watch their logs for polling connections like these all the time.