info

WP iTunes

Notes: WP iTunes is a WordPress plugin that allows you to display your currently playing song in iTunes on your WordPress-powered blog. You must download and install client software on your machine that will post the current song to your blog in order for WP iTunes to work. I recommend and use iTunesBlogger, which is a client for Windows only. WP iTunes will retrieve and store the current track, artist, album, genre, and album cover art. Installation:
  1. Download wpitunes.zip and unzip it into your /wp-content/plugins directory.
  2. Open the wp-itunes.php file in the /wp-content/plugins directory and make sure and at least modify the $itunes_key variable.
  3. You must also obtain a developer token from Amazon if you want to retrieve the album cover art. Check here for details. After you get the token, enter it in the $dev_token variable.
  4. Activate the plugin from your WordPress admin 'Plugins' page.
Setting up iTunesBlogger After you download and install iTunesBlogger, there are a couple values you will have to set before you can begin updating your blog. When iTunesBlogger is running, go to 'Options' and click 'Settings'. There you will see a field called 'Update URL'. In that field you want to enter a URL like: http://path-to-your-wp-blog/?wpitunes=value-of-$itunes_key-var&track=%t&artist=%a&album=%b&genre=%g replacing 'path-to-your-wp-blog' with the URL to your WordPress blog, like www.lucky-33.com, and replacing 'value-of-$itunes_key-var' with the value of the $itunes_key variable you entered in the wp-itunes.php file. Then, click the checkbox titled 'Enable Web Update' and click the 'OK' button. iTunesBlogger should now be set, and when you run iTunes, you should see the recently played songs displayed in iTunesBlogger. Functions Now that you've got the plugin installed, you probably want to display your songs. The function to call is 'get_wp_itunes($limit)', and you can insert it on any page where you want your songs displayed.
  1. <?php
  2. //Function to display the most recent iTunes song, argument will be the number of songs to return
  3. get_wp_itunes(1);
  4. ?>
the XHTML returned will look like: You are on your own as far as styling the returned XHTML goes, so you can incorporate it into your own blog's colors/scheme. Links: Release History
  • Apr 24, 2005: v1.1 - Added support for retrieving album art through cURL libraries, and added local caching of album art
  • Oct 10, 2004: v1.0 - released to the wild

Notes:

WP iTunes is a WordPress plugin that allows you to display your currently playing song in iTunes on your WordPress-powered blog. You must download and install client software on your machine that will post the current song to your blog in order for WP iTunes to work. I recommend and use iTunesBlogger, which is a client for Windows only. WP iTunes will retrieve and store the current track, artist, album, genre, and album cover art.

Installation:

  1. Download wpitunes.zip and unzip it into your /wp-content/plugins directory.
  2. Open the wp-itunes.php file in the /wp-content/plugins directory and make sure and at least modify the $itunes_key variable.
  3. You must also obtain a developer token from Amazon if you want to retrieve the album cover art. Check here for details. After you get the token, enter it in the $dev_token variable.
  4. Activate the plugin from your WordPress admin ‘Plugins’ page.

Setting up iTunesBlogger

After you download and install iTunesBlogger, there are a couple values you will have to set before you can begin updating your blog. When iTunesBlogger is running, go to ‘Options’ and click ‘Settings’. There you will see a field called ‘Update URL’. In that field you want to enter a URL like:

http://path-to-your-wp-blog/?wpitunes=value-of-$itunes_key-var&track=%t&artist=%a&album=%b&genre=%g

replacing ‘path-to-your-wp-blog’ with the URL to your WordPress blog, like www.lucky-33.com, and replacing ‘value-of-$itunes_key-var’ with the value of the $itunes_key variable you entered in the wp-itunes.php file. Then, click the checkbox titled ‘Enable Web Update’ and click the ‘OK’ button. iTunesBlogger should now be set, and when you run iTunes, you should see the recently played songs displayed in iTunesBlogger.

Functions

Now that you’ve got the plugin installed, you probably want to display your songs. The function to call is ‘get_wp_itunes($limit)’, and you can insert it on any page where you want your songs displayed.

  1. <?php
  2. //Function to display the most recent iTunes song, argument will be the number of songs to return
  3. get_wp_itunes(1);
  4. ?>

the XHTML returned will look like:

  1. <div class="itune">
  2. <a href="itms://apple.phobos.com"><img src="http://www.amazon.com/image" alt="Track: Track1\nArtist: Artist1\nAlbum: Album1\nGenre: Genre1" /></a>
  3. <ul>
  4. <li><strong>Track:</strong>&nbsp;Track1</li>
  5. <li><strong>Artist:</strong>&nbsp;Artist1</li>
  6. <li><strong>Album:</strong>&nbsp;Album1</li>
  7. <li><strong>Genre:</strong>&nbsp;Genre1</li>
  8. <li><strong>When:</strong>&nbsp;11:43 pm on Oct 12, 2004</li>
  9. </ul>
  10. </div>

You are on your own as far as styling the returned XHTML goes, so you can incorporate it into your own blog’s colors/scheme.

Links:

Release History

  • Apr 24, 2005: v1.1 - Added support for retrieving album art through cURL libraries, and added local caching of album art
  • Oct 10, 2004: v1.0 - released to the wild