On Sun, Jul 25, 2010 at 5:09 PM, Andrew Armstrong
<address@hidden> wrote:
Hi Mike this is great news.
Can you please give me an example of how I can access one of your streams?
First you'll need to authenticate with our radio service by sending a GET request to
http://alpha.libre.fm/radio/handshake.php with the parameters "username" and "passwordmd5" (this should be an md5 hash of the user's password). You'll get a response containing "session=yoursessionkey". You'll need to retrieve the session key from that.
Next you select the station you want to play by sending a GET request to
http://alpha.libre.fm/radio/adjust.php with the parameters "session" and "url". The session should be the key you fetched earlier, url should be something along the lines of librefm://globaltags/folk (if you wanted to play folk music to your gamers).
Finally you get a playlist by doing a GET to
http://alpha.libre.fm/radio/xspf.php with the parameters "sk" (your session key) and "desktop=1". This will return an xml document containing links to 5 ogg vorbis files that you can play (along with artist details, track name, length, etc.) once you get through those 5 make another request to xspf.php to get another 5.
Alternatively you can use the webservice mechanism documented at
last.fm/api but I don't think that'd be as appropriate for a game.
Hope this helps,
Mike.