2004-09-06 Music

The RSS feed by the Audioscrobbler guys (2004-09-05 Music) is broken. So I looked up their contact info on the web and joined ​#audioscrobbler on irc.phasenet.co.uk, talked to *Russ* and got a copy of his PHP/Smarty thing. I don’t know PHP, I don’t know Smarty, but I looked at his code, looked at some code samples ¹, and got going.

2004-09-05 Music

¹

Here’s a version that worked well, except that the $now was later changed by Russ.

<?xml version="1.0"?>
<rss version="2.0"
     xmlns:cc="http://backend.userland.com/creativeCommonsRssModule">
  <channel>
    <title>Audioscrobbler Musical Profile: {$user->name|htmlspecialchars}</title>
    <link>http://{$webhost}{$user->getURL()}/</link>
    <description>{$user->name|htmlspecialchars}'s last played tracks, as recorded by Audioscrobbler.com</description>
    <cc:license>http://www.creativecommons.org/licenses/by-nc-sa/1.0</cc:license>
    <lastBuildDate>{$now|date_format:"%a, %d %b %Y %T %Z"}</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Audioscrobbler RSS 2.0 Generator</generator>
    <webMaster>support@audioscrobbler.com</webMaster>
{if $tracks|is_array}
{foreach from=$tracks item=track}
    <item>
      <link>http://{$webhost}{$track->getURL()}</link>
      <description>{$track->getLinkText()|htmlspecialchars}</description>
      <pubDate>{$track->lastdate|date_format:"%a, %d %b %Y %T %Z"}</pubDate>
    </item>
{/foreach}
{/if}
  </channel>
</rss>

Truly, RSS 2.0 is so much simpler than RDF-based RSS 1.0!

​#Music