Run for cover

Download widget

This is my latest widget for WordPress. If you use to remember the music you listen to, this widget finds the cd covers for the music you listen most often to. I already had a widget that did this, but it used an XML-feed from that never updates, so you always saw the same cd covers.

How to show your favorite cds on your wordpress weblog:

  • Make sure your version of WordPress is 2.0 or higher
  • Make sure your template is widget-ready
  • Download Run For Cover version 1.4 here
  • Extract the file and ftp it to the wp-content/plugins/widgets folder on your server
  • Configure this widget under Presentation » Sidebar Widgets

You can choose where the images link to: (default) or Amazon. If you choose to link to the Amazon product page, please note that this includes my associate id for Amazon.

The way it works for those interested:

  • it opens an HTML page at
  • filters the source of that page and finds the data for the cds
  • writes the data to the javascript file
  • browser sends an Ajax request to the server to find the cd cover image from Amazon
  • adds the image to the page

version 1.4

  • the period from which to use data is configurable now (last week, last 3 months, last 6 months, last year, all)
  • check for new version is no longer automatic, version can be checked by clicking on a link in the config
  • couple of small bugs fixed
  • you can easily check for a new version of this widget

version 1.3

  • added ‘Loading…’ text which is configurable, it disappears when first image is loaded
  • added ‘No images to display’ along with the necessary checks — this text is also configurable
  • single quote in artist/album names is replaced with ` to avoid javascript errors
  • widget now starts loading images after page has finished loading

Earlier versions:

  • you can specify in the options if you want to link to Amazon or to ( is default) (version 1.2)
  • changed to weekly feed (version 1.1)

Let me know what you think!

14 reacties

  1. Hello there!

    Thank you for creating this widget… the previous widget for wasn’t so great, and I’ve been looking for something that displays recent tracks instead of just my top albums which rarely change.

    I tried to implement it on my theme, but it breaks the whole site.. It looks to be something in the end of the display output because it’s trying to put a whole lot of my blog (including the main content section) in smaller boxes on the sidebar.

    Here’s some screenshots to give you an example:

    With your plugin activated (It’s the “Recent Music” titled widget)
    What my site looks like normally

    I have even tried disabling the other widget to no avail.

  2. @Haggis, we already solved this by e-mail — I add this to the comments for other people experiencing this. The widget uses

    <div id=”runforcover” />

    at line 195 (version 1.2). As some templates use div’s to apply background images to the widgets, you can change the div into

    <span id=”runforcover” />

    as long as you don’t change the id. This widget will keep using the div for now.

  3. Hi! Great widget!

    I wanted to use small images, so I took a look at the code and found line 376:

    $_url = stringBetween($_amazon_xml, ‘<MediumImage>’, ‘</MediumImage>’);

    and changed it to

    $_url = stringBetween($_amazon_xml, ‘<SmallImage>’, ‘</SmallImage>’);

    this way, you get 75*75 images from Amazon instead of 160*160, which is a good idea if you’re not going to display larger images.

    Just in case anyone was wondering

Geef een reactie

Het e-mailadres wordt niet gepubliceerd.