Topic: ZR Development (9)
New JSON Feed for Recent Tracks
Friday January 2, 2009 1:14 AM
We just added a JSON formatted feed for recent tracks to make manipulation with JavaScript easier. The JSON feeds work lust like the recent tracks feeds:
Full feed: http://zenradar.roblogic.net/service/1.0/user/[username]/recenttracks.json
Specify number of results (1-10): http://zenradar.roblogic.net/service/1.0/user/[username]/recenttracks_[1-10].json
Here's the easy way to cache the feed on your site. Run this script from cron on a regular basis, then pull the cached file in your JavaScript to keep things snappy.
Full feed: http://zenradar.roblogic.net/service/1.0/user/[username]/recenttracks.json
Specify number of results (1-10): http://zenradar.roblogic.net/service/1.0/user/[username]/recenttracks_[1-10].json
Here's the easy way to cache the feed on your site. Run this script from cron on a regular basis, then pull the cached file in your JavaScript to keep things snappy.
<?php
//from marc2003's script on last.fm forum
$user = 'roblogic'; //last.fm username
$remotefile = "http://zenradar.roblogic.net/service/1.0/user/$user/
recenttracks.json";
$localfile = $user.'.json';
try
{
$ch = curl_init($remotefile);
$fp = fopen($localfile, "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
catch (Exception $e)
{
echo $e->getMessage();
echo '<pre>';
echo $e->getTraceAsString();
echo '</pre>';
}Context: ZR Development
Artist images in recent tracks feed
Sunday April 20, 2008 3:38 PM
Someone on the last.fm forums was asking about artist images for recently scrobbled tracks, so I though I'd look into adding them to our recent tracks feed.
Unfortunately, that artist info is really hard to get to on-demand. There's no info feed for artists, so even though you can get Similar Artists, Top Fans, Top Tracks, Top Albums, Top Tags, and Current Events, you can't get a simple artist detail. However, if you pull the similar artists feed, pick the first artist in the list, then pull that artist's similar artists feed, you can spin through those artists and find the target artist. This method does work, but does not seem to generate matches for all artists, so there are some blanks here and there. I've got a cron job running to update all of the artists that are already cached in our DB (around 1100) with the image data, it should be done by this time tomorrow. Any artists not already in our DB will have their image data saved as they come in on the last.fm recent tracks feeds.
ZenRadar recent tracks feeds now have small and large artist images in the artist nodes, like this:
<artist mbid="">
Sound Tribe Sector 9
<url>http://www.last.fm/music/Sound+Tribe+Sector+9</url>
<image_small>http://userserve-ak.last.fm/serve/50/86460.jpg</image_small>
<image_large>http://userserve-ak.last.fm/serve/160/86460.jpg</image_large>
</artist>
Which will give you:


Artists that we haven't found images for will have the last.fm default "no artist" images:

http://cdn.last.fm/depth/catalogue/noimage/noartist_50px.jpg

http://cdn.last.fm/depth/catalogue/noimage/noartist_140px.jpg
I hope this is useful, let me know if you have any questions, or if you'd like artist images added to any of the other feeds.
Unfortunately, that artist info is really hard to get to on-demand. There's no info feed for artists, so even though you can get Similar Artists, Top Fans, Top Tracks, Top Albums, Top Tags, and Current Events, you can't get a simple artist detail. However, if you pull the similar artists feed, pick the first artist in the list, then pull that artist's similar artists feed, you can spin through those artists and find the target artist. This method does work, but does not seem to generate matches for all artists, so there are some blanks here and there. I've got a cron job running to update all of the artists that are already cached in our DB (around 1100) with the image data, it should be done by this time tomorrow. Any artists not already in our DB will have their image data saved as they come in on the last.fm recent tracks feeds.
ZenRadar recent tracks feeds now have small and large artist images in the artist nodes, like this:
<artist mbid="">
Sound Tribe Sector 9
<url>http://www.last.fm/music/Sound+Tribe+Sector+9</url>
<image_small>http://userserve-ak.last.fm/serve/50/86460.jpg</image_small>
<image_large>http://userserve-ak.last.fm/serve/160/86460.jpg</image_large>
</artist>
Which will give you:


Artists that we haven't found images for will have the last.fm default "no artist" images:

http://cdn.last.fm/depth/catalogue/noimage/noartist_50px.jpg

http://cdn.last.fm/depth/catalogue/noimage/noartist_140px.jpg
I hope this is useful, let me know if you have any questions, or if you'd like artist images added to any of the other feeds.
Context: ZR Development
Zen Radar on build.last.fm
Monday April 14, 2008 9:23 AM
ZR has been added to build.last.fm. We're proud to be a part of the growing last.fm developer community.
If you're new here, take a moment to read about what this thing is and find out how to use it. If you have questions, check the FAQ, or feel free to contact us. If you're ready to get a closer look, create an account and dive right in.
Recent Loved Tracks RSS
Thursday April 26, 2007 12:25 PM
Some people on the last.fm forum have been asking for an RSS feed for recently loved tracks, so I whipped one up for ZR users. This feed does not contain album info or art, if you find this feed useful, and would like to see the album info added, let us know.
Here's the feed URL:
http://zenradar.roblogic.net/service/1.0/user/[your username]/recentlovedtracks.rss
I'm not sure if there is much demand for RSS over XML, if you'd like to have more RSS feeds, speak up and we'll get on it.
Here's the feed URL:
http://zenradar.roblogic.net/service/1.0/user/[your username]/recentlovedtracks.rss
I'm not sure if there is much demand for RSS over XML, if you'd like to have more RSS feeds, speak up and we'll get on it.
Context: ZR Development
last.fm & audioscrobbler offline
Thursday April 26, 2007 11:26 AM
last.fm and ws.audioscrobbler.com went down temporarily this morning. We took this opportunity to enhance some of the error handling in the feeds in order to fail gracefully in this situation. Our recent tracks feeds are unphased by such an outage, your feed will be pulled entirely from our cached data. The other feeds will simply be empty.
As of this post, the servers seem to be back online.
As of this post, the servers seem to be back online.
Feed Format Changed
Monday April 2, 2007 10:08 AM
We've changed the format of the feeds slightly in order to more closely mirror the audioscrobbler format. The change affects the cover art in the album block.
The new format is:
Changed from:
Thanks to johnnaked for keeping us in line
The new format is:
<album>
<name></name>
<url></url>
<coverart>
<small></small>
<medium></medium>
<large></large>
</coverart>
</album>Changed from:
<album>
<name></name>
<url></url>
<coverart_small></coverart_small>
<coverart_medium></coverart_medium>
<coverart_large></coverart_large>
</album>Thanks to johnnaked for keeping us in line
Recent Tracks Widget
Wednesday March 21, 2007 3:50 PM
This little widget displays your recent tracks list with album data, and lists your last.fm friends. If they have ZenRadar accounts, you can see their lists too. The widget is based on jcr313's excellent last.fm recent tracks widget. Thanks James!
Since your ZR info requires requests to your feeds in order to stay up-to-date, this widget can help keep your recent tracks data in sync.
Mac OS X 10.4 Tiger is required. If you’re using Safari, click the download link. When the widget download is complete, show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it. If you’re using a browser other than Safari, click the download link. When the widget download is complete, unarchive it and place it in /Library/Widgets/ in your home folder. show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it.
Download Now!
Since your ZR info requires requests to your feeds in order to stay up-to-date, this widget can help keep your recent tracks data in sync.
Mac OS X 10.4 Tiger is required. If you’re using Safari, click the download link. When the widget download is complete, show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it. If you’re using a browser other than Safari, click the download link. When the widget download is complete, unarchive it and place it in /Library/Widgets/ in your home folder. show Dashboard, click the Plus sign to display the Widget Bar and click the widget’s icon in the Widget Bar to open it.
Download Now!

Recent Tracks Quilts
Tuesday March 20, 2007 10:34 PM
Your recent tracks can be displayed as an album cover quilt. The quilt is displayed as an HTML table. You can choose any square number to display between 4 and 49.
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_4.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_9.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_16.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_25.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_36.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_49.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_4.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_9.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_16.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_25.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_36.html
http://zenradar.roblogic.net/service/1.0/user/[username]/quilts/recenttracks_49.html
Context: ZR Development
New Feeds Available
Monday March 19, 2007 11:15 PM
You can now pull your weekly top albums, weekly top tracks, top albums, and top tracks feeds, complete with album info. Currently, we're limiting the feeds to the top 10. Links can be found on your dashboard.
Examples:
Top Tracks
Top Albums
Weekly Track Chart
Weekly Album Chart
Examples:
Top Tracks
Top Albums
Weekly Track Chart
Weekly Album Chart
Context: ZR Development







































