Current version is 126.96.36.199 released on 2013-11-11
Other Editions: iTunes for Windows | iTunes for Mac OS X | Winamp
The Now Playing plugin allows you to easily publishing what you are listening to! The end result is something that could look like this on your web site!
Windows Media Player allow you to create plugins that can do various tasks for you. The Now Playing plugin monitors the song you are listening to and publishes the data in various ways:
- Creates a XML file with information on that song. A file called now_playing.xml is created in your Windows Media Player Plugins directory.
- The plugin also offers you the ability to FTP/SFTP that file to a server of your choosing after its updated.
- Create a ping with the song information.
- Post information on Twitter.
- Post information on Facebook.
The idea is that you publish the XML up to your web server and then through some scripting magic, you can display your currently playing song or your recently played tracks. To make your web site more interactive, the plugin also retrieves the following information for you to use:
- URL of the album image cover art from Amazon.com (if found).
- Link to the Amazon.com product page for the CD (if found).
- Link to the Apple iTunes Music Store product page with the song highlighted within iTunes (if found).
- Run the installer.
- Start Windows Media Player.
- The configuration screen will come up right away the first time you run Windows Media Player after installing. Fill in whatever information suits you and hit OK when you are done.
- Play a song!
About: Get version information.
Options: Configure a few basic options for the plugin.
- Publish Stop: If you want the plugin to publish a message when you stop playing music. The playlist in the XML will be emptied but it is still cached for the next time you fire up Windows Media Player.
- Clear Playlist: When the player exits, you can choose to keep or clear the playlist memory for the plugin.
- Playlist Delay: The playlist will only keep a new entry if it plays for at least the amount of time specified. If you change tracks before the time elapses, the playlist entry for the song you skipped will be overwritten with the next song. So instead of advancing the oldest item off the list, it leaves the items in tact and just overwrites the prior.
- Skip Shorter Than: If a track is shorter than this number of seconds, the track will be skipped from all output interfaces (XML, Twitter, Facebook, etc.). This is helpful if you have short sound effects in your playlist that you do not want to publish. If set to 0, the setting is effectively disabled and all tracks will be published.
- Skip Kinds: If a track matches this list of kinds, the track will be skipped from all output interfaces (XML, Twitter, Facebook, etc.). This is helpful if you don’t want to publish video, for example. This is a comma separated list of values. The value for each kind should be taken from the XML’s kind tag.
- Logging: If you are not getting the results you expect from the plugin, you may want to enable logging. A file called NowPlaying-Log.txt will be generated in the Program Files\Windows Media Player\plugins\Now Playing directory. If you contact me about an issue, I will be more likely to solve your issue if you send the log file with the event captured at the debug log level.
XML: Configure some options for the XML file that will be generated.
- Output File: Specify the location of the file that is created when the song changes. This file will be uploaded to your FTP/SFTP server if configured to do so. You may use date/time formatting codes, such as %Y, in the filename.
- Encoding: Select which type of encoding your want for the XML. UTF-8 is the recommended choice.
- XSL URL: This URL will be insert into your XML. You may leave the it empty if you do not use that functionality.
- Wrap XML tag values with CDATA: Some song properties have odd characters inside of them and you may need to safely encode the XML depending on your parser.
- Playlist Length: Enter the total number of songs that you want to publish in the XML file.
Upload: Enter your server information to configure FTP/SFTP. Be sure that you have permission on your server to upload the file.
- Protocol: Choose from None, FTP, and SFTP.
- Hostname: Your FTP/SFTP server name or IP address.
- Username: Your FTP/SFTP login.
- Password: Your FTP/SFTP password.
- Filename: You may use date/time formatting codes, such as %Y, in the filename.
Ping: The plugin can send an HTTP POST request when the song changes. The request is sent after the upload of the XML file, if configured. Each of the XML tag names for the track are posted as fields.
- URL: Enter a URL that will receive the POST request.
- Extra Info: Enter a value that will be sent as a HTTP header called X-NowPlaying. You can use this to set a secret value that your script looks for to prevent unauthorized use.
Twitter: The plugin can post a tweet with what you are listening to.
- Enabled: Turn the feature on or off.
- Rate Limit: Enter the minimum number of minutes between tweets. This is used to comply with Twitter’s rate limiting. Also helps so you don’t annoy the crap out of your followers with a tweet for every track you play.
- Message: Enter the text that you want to post for each new song that plays. You can use a combination of the tags listed below the field for the song data. The text will be substituted and should be less than 140 characters (Twitter limit).
- Setup: You need to complete the three phase setup to add and authorize the plugin to work with Twitter. 1) Press Authorize to launch a web browser and give Now Playing access. 2) You will get a PIN from Twitter that you enter in the field. 3) Verify the PIN by pressing Verify. 4) You should see your Twitter name appear there with an option to reset if you want to start over or remove the association.
Facebook: The plugin can update your Facebook news feed with what you are listening to.
- Enabled: Turn the feature on or off.
- Rate Limit: Enter the minimum number of minutes between posts. This is used to comply with Facebook's rate limiting. Also helps so you don't annoy the crap out of your friends with a post for every track you play. This is currently required to be 30 minutes or more because of Facebook's ban on spammy apps.
- Caption: Enter the text that you want to post for each new song that plays. You can use a combination of the tags listed below the field for the song data.
- Description: Enter the text that you want for the description of the news feed item for each new song that plays. You can use a combination of the tags listed below the field for the song data.
- Setup: You need to complete the two phase setup to add and authorize the plugin to work with Facebook. Press each of the buttons in sequence and follow the instructions. You should see your Facebook name appear there with an option to reset if you want to start over or remove the association when you have completed the steps.
Amazon: The plugin will query Amazon.com for additional information about your song, such as a link and the album image cover.
- Enabled: Turn the lookup on or off.
- Locale: Choose “us” for Amazon in the US, “ca” for Amazon in Canada, “uk” for Amazon in the United Kingdom, “de” for Amazon in Germany, or “jp” for Amazon in Japan.
- Associate ID: Amazon allows you to collect referral fees on items sold when users click-through from your site. Enter your associate ID here.
- ASIN Hint: Since Amazon’s search is quirky for some albums, you can use this feature to specify the exact album you want to match. Check this box if you want the plug-in to assume the value of the track’s “music category description” field (WMP 10 and below) or “Subgenre” field (WMP 11 and higher) is an Amazon ASIN.
Apple: The plugin will query Apple’s iTunes Music Store for additional information about your song, such as a link.
- Enabled: Turn the lookup on or off.
- Affiliate ID: Want to receive a commission when users click-through and buy songs from your site at the iTunes Music Store? Join the Apple iTunes Affiliate program. Find out what your Affiliate ID is and plug it in here.
License: If and when you purchase a license, you will enter your registration information on the license tab. Enter the e-mail address you used for the PayPal transaction and the license key I sent you after the purchase.
The XML has the following format for a single song playlist. If you configure the playlist for more than 1 entry, there will be multiple song tags.
<?xml version="1.0" encoding="UTF-8"?>
<now_playing playing="1" timestamp="2004-05-24T23:12:46-07:00">
<kind>MPEG audio file</kind>
<comments>I like it.</comments>
- Q: I lost my registration key. Can you resend it?
A: You can retrieve it yourself here.
- Q: How do I uninstall the plugin?
A: Go to the Windows Control Panel, choose Add/Remove Programs, and then select Now Playing.
- Q: How can I get a debug log?
A: Go to the plugin’s configuration screen and select the Options tab. For Logging, select Debug. Reproduce your issue now. A file called NowPlaying-Log.txt will be generated in the Program Files\Windows Media Player\plugins\Now Playing directory.
- Q: How can I get back to the configuration screen?
A: To configure any plugin, go to the menubar and choose Tools->Options->Plugins. Choose the Background category. Now Playing will appear on the right. Choose Properties.
- Q: Why aren’t my Amazon or Apple links populated in the XML?
A: It is because the Amazon or Apple search engine cannot find the album. These engines can be picky at times.
- Q: Can you show me how to parse the XML file on my server?
A: Sure. This sample will work for a single song or multiple songs.
$file = "now_playing.xml";
$xml_parser = xml_parser_create();
if ( is_file( $file ) )
$fp = fopen( $file, "r" );
$data = fread( $fp, filesize( $file ) );
fclose( $fp );
xml_parse_into_struct( $xml_parser, $data, $vals, $index );
xml_parser_free( $xml_parser );
if ( $debug )
echo "Index array\n";
echo "\nVals array\n";
if ( $vals[ $index["NOW_PLAYING"] ]["attributes"]["PLAYING"] == 1 )
foreach ( $index["TITLE"] as $i => $j )
$title = $vals[ $index["TITLE"][$i] ]["value"];
if ( strlen( $title ) > 0 )
$artist = $vals[ $index["ARTIST"][$i] ]["value"];
$album = $vals[ $index["ALBUM"][$i] ]["value"];
$genre = $vals[ $index["GENRE"][$i] ]["value"];
$kind = $vals[ $index["KIND"][$i] ]["value"];
$track = $vals[ $index["TRACK"][$i] ]["value"];
$year = $vals[$index["YEAR"][$i] ]["value"];
$comments = $vals[ $index["COMMENTS"][$i] ]["value"];
$time = $vals[ $index["TIME"][$i] ]["value"];
$bitrate = $vals[ $index["BITRATE"][$i] ]["value"];
$rating = $vals[ $index["RATING"][$i] ]["value"];
$playcount = $vals[ $index["PLAYCOUNT"][$i] ]["value"];
$compilation = $vals[ $index["COMPILATION"][$i] ]["value"];
$urlamazon = $vals[ $index["URLAMAZON"][$i] ]["value"];
$urlapple = $vals[ $index["URLAPPLE"][$i] ]["value"];
$imagesmallurl = $vals[ $index["IMAGESMALL"][$i] ]["value"];
$imageurl = $vals[ $index["IMAGE"][$i] ]["value"];
$imagelargeurl = $vals[ $index["IMAGELARGE"][$i] ]["value"];
$composer = $vals[ $index["COMPOSER"][$i] ]["value"];
$grouping = $vals[ $index["GROUPING"][$i] ]["value"];
$urlsource = $vals[ $index["URLSOURCE"][$i] ]["value"];
$filename = $vals[ $index["FILE"][$i] ]["value"];
echo "Now Playing is " . $title . " by " . $artist;
echo "Now Playing is stopped.";
- Q: I don’t understand all of this PHP stuff but I still want to do all these cool things. Can you help?
A: Ok, I have zipped up the actual code I use on my own web site. You can download it and use it for your site or as a starter. Please don’t mail me to customize it for you. I don’t have time. So to use this: 1) Take the zip file and extract and place the files on your PHP-enabled web server. 2) Put the images into /images on your server. 3) Insert the following code in the web page that you want to display the music.
I have done my fair share of free plugins lately. This one took a little more work so I decided to release it as shareware. So download the plugin and test it out. Make sure it does what you want. Once you are happy, order the licensed version for $5. You will receive a registration key via e-mail once I receive your purchase confirmation from PayPal. Oh yeah — be cool and keep your registration to yourself.
Also, if you would, you can put the Now Playing badge on your web site with a link back to this page. The more people that donate, the more I will be asked to develop new and interesting features that you will be able to take advantage of!
Here is the code for your site:
<img src="http://brandon.fuller.name/images/now_playing.png" alt="Now Playing" />
Download the current version from the link below. Past versions are not archived.
A chronological list of how we got here.
v188.8.131.52 -- 2013-11-11
- Updated to work with Apple's new iTunes affiliate program. Sign up here.
v184.108.40.206 -- 2013-03-15
- Fixed Facebook integration. Again. Facebook started doing something "smart" when we give them URLs to Amazon albums. It blows away all your custom text and uses text scraped from Amazon. This does not appear to happen with iTunes links. I use iTunes anyway. So I switched to iTunes links and they seem to be showing up more like they are intended, in most cases. In some cases, you continue to get an iTunes text scrape with it. The other choice would be to remove the link all together which might be the next answer.
- Changed the default Facebook message because "actor" no longer works.
- Removed Facebook rate limit limit of 30 minutes.
v220.127.116.11 -- 2013-03-03
- Fixed Twitter authorization issue after Twitter changed OAuth endpoint.
v18.104.22.168 -- 2012-12-01
- Fixed error where plugin thinks its the first run if XML file not configured.
v22.214.171.124 -- 2012-10-16
- Fixed Twitter posting. Again. Some users getting "bad authorization" with code 215.
v126.96.36.199 -- 2012-10-11
- Fixed Twitter posting. Twitter deprecated the API the plugin used.
v188.8.131.52 -- 2012-02-28
- Fixed logging configuration user interface that I busted.
v184.108.40.206 -- 2012-02-12
- Lower Facebook Rate Limit to 30 minutes minimum.
v220.127.116.11 -- 2011-05-31
- Fixed issue with Amazon lookups involving dots, underscores, and tildes in the artist or album name.
- Prevent use of email addresses as Amazon Associate IDs as those are not valid.
v18.104.22.168 -- 2011-05-03
- Internal updates to support usage tracking.
v22.214.171.124 -- 2011-04-27
- Facebook rate limit fixed at 360 minutes.
v126.96.36.199 -- 2011-04-26
- Facebook integration has been restored. Details.
v188.8.131.52 — 2011-03-15
- Fixed issue where some Amazon cover art wasn’t being displayed in Facebook news feed posts because of URL encoding issues.
v184.108.40.206 — 2011-02-25
- Changed default rate limits from 60 to 0 to prevent user confusion.
v220.127.116.11 — 2010-08-11
- Apple changed the iTunes Link Maker again. Updated to work with new API.
- Added imageLocalSmall and imageLocalLarge elements to the XML output in order to help with media center integrations.
v18.104.22.168 — 2010-04-28
- Removed Facebook error message dialog box. Message in error log.
v22.214.171.124 — 2010-03-13
- Fixed issue where some international characters were not displayed properly in Twitter and Facebook messages and screen names.
- Fixed issue where Facebook description value was not saved.
- Fixed issue where Facebook message in news feed only had cover art and no text.
v126.96.36.199 — 2010-03-02
- Added ability to customize the Facebook description for posting news feed items. Previously, it posted the comments field.
- Added ability to skip kinds of media. Maybe you don’t want to post video updates, for example.
- Changed Facebook news feed items so that they do not post as status if no Amazon URL is found.
v188.8.131.52 — 2010-02-25
- Fixed issue where Apple iTunes lookup did not deal with non-ASCII characters properly.
v184.108.40.206 — 2010-02-10
- Fixed issue where Twitter OAuth signatures were too short because of a buffer issue. Prevented authorization in some cases.
v220.127.116.11 — 2010-02-09
- Fixed issue where Twitter Rate Limit option not being stored properly.
- Add more debug logs for Twitter authorization process to help troubleshooting.
v18.104.22.168 — 2010-02-07
- Changed Facebook option to publish to status or news feed. You must perform the 1, 2, 3 setup on the configuration page again. More info.
- Changed Twitter option to use OAuth login.
- Added rate limit option to Twitter.
v22.214.171.124 — 2010-01-23
- Added “Skip Shorter Than” to Options configuration.
- Moved comments to DISQUS for better interaction.
v126.96.36.199 — 2009-11-09
- Apple changed iTunes links again.
v188.8.131.52 — 2009-08-18
- Amazon began requiring requests to be signed so signatures added.
v184.108.40.206 — 2009-03-27
- Updated installer dependency order to fix Windows 7 install registration issue.
v220.127.116.11 — 2009-03-16
- Reports of install failures so upgraded DLL registration method in NSIS.
v18.104.22.168 — 2009-01-05
- Added timestamp and hasAmazon tags to Facebook function.
- Added default Facebook message.
- Fixed Apple lookup for new server URL.
v22.214.171.124 — 2008-11-17
- Added support for new Facebook profile.
- Added file permission checks in installer for log and XML files.
v126.96.36.199 — 2008-07-08
- Stopped URL encoding Facebook image URLs because Facebook does not like them anymore.
- Added urlAmazon as a Facebook tag.
v188.8.131.52 — 2008-02-20
- Migrating to Amazon Associates Web Service 4.0.
v184.108.40.206 — 2007-08-18
- Removed FTP and SFTP warning dialog boxes. All errors are logged in the log instead.
v220.127.116.11 — 2007-08-03
- Added Amazon image tags to Facebook output tags.
- Adjusted list of Facebook output tags based on plugin edition.
v18.104.22.168 — 2007-07-17
- Added Facebook “Add Application” button.
- Fixed incorrect error message on Facebook authorize.
v22.214.171.124 — 2007-07-05
v126.96.36.199 — 2007-03-22
v188.8.131.52 — 2007-01-14
- Fixed artwork ID value in XML to use UTF-8 characters before MD5 hashing.
v184.108.40.206 — 2006-12-19
- Added UTF-8 encoding for ping data.
v220.127.116.11 — 2006-09-14
- Apple broke the music store links — again.
- Support for pinging SSL sites.
v18.104.22.168 — 2006-07-27
- Update software version check.
v22.214.171.124 — 2006-06-29
- Overhauled the ping functionality to support POST of all data elements to URL.
- Added extra info field to ping.
- Fixed Apple iTunes Music Store links. Apple changed format of link maker again.
- Removed choice of Amazon image size from configuration.
- Added all Amazon images sizes to the XML and ping.
v126.96.36.199 — 2006-03-31
- Fixed issue with Amazon lookups when colons or apostrophes were in album or artist name.
v188.8.131.52 — 2006-02-13
- Changed duplicate track detection mechanism.
- Fixed issue with log file path which caused log not to generate.
v184.108.40.206 — 2005-11-13
- Fixed iTunes Music Store lookups after Apple changed the link generator.
v220.127.116.11 — 2005-10-31
- Better detection for duplicate tracks in playlist.
v18.104.22.168 — 2005-10-12
- File uploads were causing problems when full path was not specified for the local XML file. Configuration now requires full path for local XML file.
- Revised the Internet upload error dialog messages.
v22.214.171.124 — 2005-10-10
- Fixed file upload issue when configuration did not have a path for the upload filename.
v126.96.36.199 — 2005-09-15
- Added option to disable Amazon and Apple lookups.
v188.8.131.52 — 2005-09-08
- Fixed uninstaller issues.
v184.108.40.206 — 2005-08-05
- Prevent installation when media player is running.
v220.127.116.11 — 2005-07-25
- Fixed FTP defect introduced in 18.104.22.168.
v22.214.171.124 — 2005-07-24
- Removed podcasting feature.
v126.96.36.199 — 2005-07-14
- Fixed issue where I assumed the ping URL entered had a ? in it.
v188.8.131.52 — 2005-05-30
- Fixed DllRegisterServer errors in installer for libcurl.dll, libeay32.dll, and libssl32.dll.
v184.108.40.206 — 2005-05-27
- Podcasting download issue where the plugin would only download the first enclosure in the feed in some cases.
v220.127.116.11 — 2005-05-10
- Added an XML parse error log to help diagnose bad feeds.
v18.104.22.168 — 2005-03-08
- Added Canada to Amazon locale choices.
v22.214.171.124 — 2005-01-27
- Updated SFTP component to latest version.
v126.96.36.199 — 2004-12-15
- Added configuration option to turn off inbox playlist.
v188.8.131.52 — 2004-12-14
- Added proxy support for podcast downloads.
- Added option to surpress FTP failed prompts.
v184.108.40.206 — 2004-12-13
- More debug logging.
- Show error when invalid FTP credentials are used.
v220.127.116.11 — 2004-12-05
- Changed podcast engine to only download one enclosure per feed per cycle. This will help when adding new feeds.
v18.104.22.168 — 2004-12-02
- Changed podcast download library to use cURL. Previous MS XML library was not properly dealing with redirects.
- Changed BitTorrent client to provide uploads after download is completed for the amount of time that download took if uploading is available.
- Stopped downloading .torrent file and just access it via HTTP now.
v22.214.171.124 — 2004-11-30
- Delete troubleshooting log on WMP startup.
- Added new MIME type: audio/mp3
v126.96.36.199 — 2004-11-13
- Added the ability to customize the XML and upload filename with various date attributes to enable rotating logs.
v188.8.131.52 — 2004-11-05
- Fixed defect for compliation matches on Amazon for playlists of length greater than 1.
- Separated the publish stop message into a publish stop and clear playlist on exit.
- Reorganized dialogs.
v184.108.40.206 — 2004-10-30
- Fixed issue where rating item in XML was off by one.
- Changed user agent to be “NowPlaying” so we can track usage.
- Added new logging functionality to aid in troubleshooting bad podcast feeds.
- Fixed a memory leak caused by podcast downloads.
- Added a registry setting to control passive FTP.
- Removed the begin and end popup balloons for the podcast downloads.
- Added audio/x-mpeg-3 as a supported MIME type.
- Changed default RSS interval to 6 hours.
- New download history management via XML.
- Added an option to suppress the creation of a playlist per RSS channel.
- Changed RSS update interval to hours from minutes.
v220.127.116.11 — 2004-10-07
- Changed ASIN hint to use music category description field because it is the same metadata element as iTunes’s grouping field.
v18.104.22.168 — 2004-10-05
- Create the directory selected for the XML file if it does not exist.
- Added an option to suppress the creation of a playlist per RSS channel.
- Changed RSS update interval to hours from minutes.
v22.214.171.124 — 2004-09-25
- Added BitTorrent support for RSS enclosure downloads.
- Fixed issue with saving Apple iTunes Affiliate ID.
v126.96.36.199 — 2004-09-21
- Added ability to specify an associate ID for links to the iTunes Music Store.
- Added URL into the comments field for MP3s downloaded through RSS enclosures.
v188.8.131.52 — 2004-09-14
v184.108.40.206 — 2004-09-14
For questions, suggestions, bug reports, and anything else, please e-mail or leave a comment. Please be sure to review the FAQ above before asking a question. Requests from those who have donated receive higher priority.
I am also trying to offer updates and support via Twitter. Follow nowplayingtool.
Updated: 2013-11-11 at 21:27
MST in Hacks
Tags: facebook microsoft nowplaying