<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>su.percilio.us &#187; last.fm</title>
	<atom:link href="http://su.percilio.us/tag/lastfm/feed/" rel="self" type="application/rss+xml" />
	<link>http://su.percilio.us</link>
	<description>Haughtily disdainful or contemptuous</description>
	<lastBuildDate>Tue, 06 Apr 2010 15:58:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Last.FM PHP Image Screen Scraper</title>
		<link>http://su.percilio.us/2008/07/lastfm-php-image-screen-scraper/</link>
		<comments>http://su.percilio.us/2008/07/lastfm-php-image-screen-scraper/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 01:21:24 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[Nerdities]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://su.percilio.us/?p=32</guid>
		<description><![CDATA[I&#8217;m pretty avid user of Last.FM. I&#8217;m not big on this social networking fad, even if I do work in the industry, but I&#8217;ve found Last.FM very useful, mainly for finding new music. I&#8217;m currently building a web-based media manger in PHP and wanted a way to automatically get images for the artists. I originally [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pretty avid user of <a title="last.fm" href="http://last.fm" target="_blank">Last.FM</a>. I&#8217;m not big on this social networking fad, even if I do work in the industry, but I&#8217;ve found Last.FM very useful, mainly for finding new music. I&#8217;m currently building a web-based media manger in PHP and wanted a way to automatically get images for the artists.</p>
<p>I originally used the <a title="discogs.com" href="http://discogs.com" target="_blank">discogs.com</a> API and although it was pretty easy to use and reasonably comprehensive, I was really disappointed in the quality of the images, not to mention I was constantly getting back images of electronic and ambient artists who had names similar to the rock bands in my collection, rather than the rock band themselves. I&#8217;m sorry, but when make a call to get images for &#8220;Cream&#8221; I don&#8217;t expect to get back some 14-year-old kid with a turntable and a DAT machine; I want freaking Clapton, Bruce, and Baker.</p>
<p>So, discogs.com left me a bit cold. But I soon learned about Last.FM and was delighted when I discovered their API. The image quality at Last.FM is superb, so I knew I wouldn&#8217;t be disappointed there. I started researching their API and realized that they didn&#8217;t really give me any info I needed other than the images and I didn&#8217;t want to have to sign up for an API key if all I wanted to do was download pictures of bands. Also, they only appear to provide three sizes of images and for many bands they have a whole slew of images available: large, medium, small, smaller, square; I wanted them all, not just the three provided by their API.</p>
<p>So, in the end I decided not to sign up for a Last.FM API key and instead wrote a very simple little PHP screen scraper that would bring back all of the images I wanted. Last.FM actually aided me in my goal by embedding a JSON string with just exactly what I needed right onto the artist page. It worked very well, so I decided to stick with it.</p>
<p>You can <a title="Last.FM PHP Image Screen Scraper" href="http://su.percilio.us/files/lastfm.zip" target="_self">download my simple screen scraper script here</a>. The zip file includes the class file and an example file.</p>
<p>It&#8217; an incredibly simple script. Just a basic class file with only one useable method. It&#8217;s written so it can be expanded, but as Last.FM&#8217;s API is under constant development, it probably won&#8217;t be. But if you just want a simple script to grab artist images from Last.FM, please download my script and let me know if you like it.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsu.percilio.us%2F2008%2F07%2Flastfm-php-image-screen-scraper%2F';
  addthis_title  = 'Last.FM+PHP+Image+Screen+Scraper';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://su.percilio.us/2008/07/lastfm-php-image-screen-scraper/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
