I've been spending all my spare time this weekend to this project but now the player is ready for release 0.1 beta ;)
You can download the gadget here:
Last.fm Stream Player gadget Download
Information about how it's made
I've used wireshark to learn how the official client was using the last.fm protocol to get a mp3 stream since this wasnt documentated on the last.fm development documentation.
The different states in the protocol are:
-
handshake 1 (for streaming)
-
handshake 2 (for scrobbling)
-
tuning into a channel
-
get metadata of current song
-
send "now playing" information
-
at the end of song submit the scrobbled song
-
go to step 1
Since vista sidebar gadgets are html/javascript only the gadget is using an windows media player activex object to play the actual stream. All the handshake and other http requests are done by ajax calls to the audioscrobbler server. You can download the source on the download page also.
Have fun!
Geert van der Cruijsen
Comments (11)