Last.fm API For A Windows Phone App – Scrobbling A Track
Learn how to programmatically scrobble a track to Last.fm.
By Den in Programming
January 19, 2013
As I discussed the basic of authentication in my previous post, the most important Last.fm feature that is added to Beem in itself is track scrobbling, which will allow you to keep records of what you listened to from your favorite music aggregation service. The implementation of the method used to send the track from the app to Last.fm is extremely similar to GetMobileSession.
|
|
The new required parameters here are the artist name, the track name, a UNIX-style timestamp and the session key that you obtained from the core authentication method. Although there is no method in C# to give you the UNIX timestamp right away, you can easily do it like this:
|
|
Also notice that the parameters for the track are sent in array format. Since I am only scrobbling one track at a time, I can use the index zero [0]. Your situation might be different. ScrobbleTrack can be invoked like this:
|
|
You should now see the track registered on Last.fm.
Feedback
Have any thoughts? Let me know over email by sending a note to hi followed by the domain of this website.