<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 12:44:40 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Philip Norton's Blog: Simple PHP Code To Get last.fm Last Played Tracks]]></title>
      <guid>http://www.phpdeveloper.org/news/17199</guid>
      <link>http://www.phpdeveloper.org/news/17199</link>
      <description><![CDATA[<p>
If you're a <a href="http://last.fm">last.fm</a> user and have been curious about how to get the latest list of your "last played" selections, <i>Philip Norton</i> has <a href="http://www.hashbangcode.com/blog/simple-php-code-get-lastfm-last-played-tracks-605.html">just the code you'll need</a>.
</p>
<blockquote>
The other day I was approached by a friend (Julie Cheung) and asked if I could create some code that would display a list of last played tracks from last.fm. Julie isn't a PHP developer and so the code I gave her had to be easily understandable so that she could edit it herself if needed. The following code is what I came up with.
</blockquote>
<p>
The code pulls from the defined user's "recenttracks" feed and parses it (via a <a href="http://php.net/simplexml_load_string">simplexml_load_string</a> call) into an object that's looped through and outputted. Data that comes back from the feed includes artist anme, name of the track, a URL to more information about it and an image of the album cover. He also includes an updated version that caches the data for three minutes so it's not always relying on the last.fm servers to be there.
</p>]]></description>
      <pubDate>Thu, 01 Dec 2011 13:41:00 -0600</pubDate>
    </item>
  </channel>
</rss>
