onAirNow
A »Now Playing« Plugin for WordPress
onAirNow is a WordPress plugin for displaying information about your currently playing song on your blog. It reads the track information from a file and displays it where you want it to appear (usually your sidebar).
I’m using it on my website since a few days and it’s really great and easy to use. Ben Turgeon
You can add the onAirNow output to every part of your blog. I prefer the sidebar as it is a common place for this kind of information. You can see how onAirNow may look on my sidebar. It works out of the box with the WordPress default themes and maybe your theme, too. It even supports WordPress Widgets!
Requirements
- WordPress (tested with versions 2.0.4, 2.1+, 2.2+ and 2.3+)
- FTP access to your blog’s server
- a music player like iTunes or Winamp
- a client program to upload the information about the currently playing song
Hi, thanks for the great plugin. I’ve integrated a plugin to my mIRC mp3 player to create and upload the file. This is just what the doctor ordered! Great stuff! Perfect! billythekid
You’ll need a client-side program which can upload a customly formatted file with the needed information via FTP to your blog. There are many programs like this as a plugin for your music player or a stand-alone program. Have a look at programs like Now Playing (by Brandon Fuller; onAirNow works out of the box) or Recent Tunes for iTunes (OS X), Now Playing (by Nevala) or Do Something for Winamp and AMIP for mIRC (supports many different music players). An AppleScript for Mac OS X to upload the song information is bundled with the onAirNow download. The script works best when used together with Quicksilver or any application which launches it after a certain key combination was pressed.
Adding onAirNow to Your Blog
I was able to do a much more elegant solution with onAirNow. David Goldstein
Download the ZIP file and unpack it. Upload the included onAirNow/
folder to your blog’s /wp-content/plugins/
folder and activate the plugin from your admin panel. onAirNow adds its own options page and also information about the currently playing song to your dashboard and below your username (you can switch this off).
Once this installation is done and if your WordPress theme supports widgets you can skip the step of adding code to your theme. Just go to the Presentation tab and choose Sidebar Editor.
If you’re not using widgets you can add the following code to your blog’s sidebar or wherever you want the track information to appear:
You may need to surround the above code with tags (or insert them inside the if-statement) if you want onAirNow on your sidebar. It depends on the theme you are using. Take a look at how other functions are inserted in your sidebar.
Uploading the Track Info File
Upload a file named onAirNow.track
(default file name, configureable) with information about artist and title and optional album, track number, year, song length, cover URL and filename to the plugin’s upload directory at /wp-content/plugins/onAirNow/onAirNowUpload/
by using the program which gets the information from your music player. The uploaded file must be readable by your web-server process.
It is wise to create a separate FTP user with access to just the onAirNowUpload/
directory.
The file format is as follows (make your client-side program generate such a file):
(SONG_LENGTH
has the format HH:MM:SS, MM:SS or just seconds.)
If for some reason you can’t upload such a pseudo-XML file there is another possibility. If no or incomplete track info was found inside your track info file a user-provided pattern will be matched against the provided song title, the filename (if provided; without the path) and the contents of the whole track info file (in this order until the track info is complete) to extract the information. This is useful if you are streaming music and you have only the song title containing all info or ID3 tags are missing and your music player can only provide the filename.
A possible pattern is: {[%n]} %a - %t {(%l {- %y})}{.%e}
Strings that work with this pattern include:
- [03] Artist – Song (Album – Year).mp3
- [03] Artist – Song (Album – Year)
- [03] Artist – Song (Album)
- [03] Artist – Song
- Artist – Song (Album – Year).mp3
- Artist – Song (Album).mp3
- Artist – Song.mp3
Play a bit around with this pattern matcher until you find what you need and be sure to report any problems!
To tell onAirNow that currently no song is playing just make your uploading program send an empty file to your server or let it write
to onAirNow.track
. If this isn’t possible on your setup you can tell onAirNow to consider the uploaded information outdated after a specific period of time. If a timeout is set, onAirNow tries to read the song length first and uses the user-set timeout as a backup in case the song length is not specified.
Users of Apple computers may need to check the “Mac User” option on the plugin’s options page if their program uploads MacRoman formatted files. You’ll notice this when characters like “äÖ懛” are not displayed at all or substituted with a wrong character.
Customize the Look of onAirNow
Inside this plugin’s directory there is a file named onAirNow.css
. You can copy it to your theme’s directory (then it is used instead of the default) and customize the look of the onAirNow inserted text. The actual content is editable on the options page. You can also toggle the display of the album name and the cover art (its URL must be set inside the
tag).
You can change the appearance of onAirNow by editing the CSS in onAirNow.css
. The CSS file is documented so it should be easy to customize.
The text or HTML which should be displayed when you don’t listen to music can be configured on onAirNow’s options page, too. You can also decide whether you want nothing to be displayed during an idle music player.
Support/Feedback
Please leave a comment on this page to provide feedback and suggestions or ask for help. But keep in mind that I do this in my spare time so don’t expect me to answer your questions immediately. Please report bugs via the contact page.
I’d also like to hear from everyone who has integrated this plugin into their blog. Just leave a comment with your URL!
Disclaimer
This plugin is provided as is. Though I did my best to produce a plugin of good quality I can’t guarantee that this plugin is safe, secure or error free. Use it at your own risk and always make a backup copy of your blog before trying new plugins or themes!
Download
Download this plugin as a ZIP file, unzip it and copy the onAirNow
folder to your blog’s plugin directory.
↓ Download onAirNow 1.8
Release Notes
onAirNow 1.8 (29th July, 2007): changes since version 1.7f
- Fixed the CSS inclusion code: the plugin’s directory can now be renamed to something different than “onAirNow”.
- Song length can now have the format hh:mm:ss, mm:ss or just seconds.
- fixed the timeout logic
- Delayed timeout by 5 seconds to give the track info a chance to be updated in case of any delay (media player, upload, server).
onAirNow 1.7f (fix-release) (1st March, 2007): changes since version 1.7
- Fixes a bug which prevented the removal of the title link
onAirNow 1.7 (28th February, 2007): changes since version 1.6
- some CSS tweaks
- Control panel quick link fixed in WordPress 2.1
onAirNow 1.6 (never released): changes since version 1.5
- Added an option to display the song info only on the homepage.
- Added widget support so there’s no need to add code to your theme’s PHP files. (thanks David Goldstein)
- Added a link to my onAirNow page through the “On Air Now” title. Thank you for leaving it there!
- some CSS tweaks (line-height)
Read older release notes on the next page…
July 10th, 2006 at 09:30
That might be really nice. I am a foobar2000 addicted person, so hopefully someone will be able to make a DLL for foobar. Would be great!
July 10th, 2006 at 18:41
To clarify things: onAirNow doesn’t support any media player in particular. It’s up to you to find a music player plugin which is able to upload the required file with the track info. If foobar2000 supports this, onAirNow is compatible!
July 13th, 2006 at 15:01
[...] onAirNow,在侧栏显示当前本地正播放的音乐详细。 player playlist sidebar [...]
July 23rd, 2006 at 02:12
i’m attempting to put this on my blog and am running into a few problems. i’m using Mac OS X and have installed Recent Tunes and have uploaded and activated the onAirNow file to my blog…but nothing that i have done has made it work (it just says “no track is currently playing” or whatever. if anyone can help me get all of this figured out, i’d really appreciate it. thanks!
July 23rd, 2006 at 13:35
Make sure (by using a FTP program) that the file containing the track info is uploaded to “
/wp-content/plugins/onAirNow/onAirNowUpload/onAirNow.track
“, contains the correct information and is readable by your web-server process. The directory “onAirNowUpload
” needs permissions of 755. Set the correct permissions and try again.Also make sure RecentTunes is configured correctly.
August 16th, 2006 at 23:08
[...] While I was configuring Now Playing to work with my Song Displayer setup I noticed a link on the bottom of the page for a WordPress plugin called onAirNow. onAirNow is more advanced yet easier to use than Song Displayer. It has an options page in the WordPress Admin section as opposed to having to change options directly in the code as you have to do with Song Displayer. [...]
August 28th, 2006 at 08:35
[...] After my attempt at upgrading to WordPress 2.0 on my own, all the code modifications I had made freaked it out and the admin side wouldn’t let me in anymore, so this is our fresh new start. I’ve been messing with some new plug-ins that I hope to have up and running soon (a cool one being onAirNow) [...]
August 31st, 2006 at 09:49
Hi, I’m using the Nowplaying plugin for iTunes which creates in XML tag which is the album artwork. How can I make onAirNow read the album art tag and display it.
August 31st, 2006 at 23:42
Lendell, it’s implemented.
Though testing is still to be done.You should have received a beta version via e-mail.October 15th, 2006 at 10:50
I am trying to get this working with winamp and Dosomething, but all it does is upload an empty onAirNow.track to my server. I’ve looked through all the documentation, but can’t find what I am doing wrong. Help!
October 15th, 2006 at 13:29
Ronald, an empty
onAirNow.track
file means that your media player plugin for uploading has the problem. I’m glad you could fix it yourself!October 15th, 2006 at 18:50
Yes I fixed it, see: http://www.popindekop.nl
October 21st, 2006 at 09:54
[...] I’ve settled (for now) on the WP-iTunes plugin to display what’s currently playing in iTunes. I started using onAirNow in conjunction with the Now Playing iTunes plugin. They worked very well and were easy to set up. But the developer of Now Playing wants to be compensated for his work (which is understandable and respectable) and I was sure I could find another solution that didn’t cost a dime. [...]
October 29th, 2006 at 21:33
Can you show an example of how to use the image tag? I have many MP3s with cover art embedded in them. Can I get these to show with oAir?
October 29th, 2006 at 23:16
You have to provide the URL of the cover art. That is your media player plugin’s job. Just surround the URL with
andin your
onAirNow.track
file.October 30th, 2006 at 20:09
That doesn’t make sense to me. I have many MP3s that have cover art embedded in them. I have never seen a URL for this purpose. This is actually the first time I’ve ever heard of a URL for this purpose. Can you explain more about this or point me to a site with some helpful info?
October 30th, 2006 at 20:28
You can’t use the embedded cover art. An iTunes plugin like Now Playing fetches the URL to the cover image from Amazon and returns it so you can display it on your blog (like onAirNow does).
October 31st, 2006 at 20:23
OK. I see what you’re saying. I’m trying to get this working using the Now Playing plugin for Winamp (http://people.cc.jyu.fi/~ltnevala/nowplaying/) but not having much success. I’m getting the album art in the plugin but it’s not writing a proper URL into the upload file. But I’m working on it.
November 2nd, 2006 at 17:12
November 2nd, 2006 at 19:28
I figured out that last part (make the album cover link to the product page on Amazon using my Amazon Associates ID). To implement in this plugin will require another additional option (to hold the Amazon Associates ID). I set the link to open the product page in a new browser window (or tab in tabbed web browsers) so that when the person browsing closes the product page they will be right back on my blog.
I have it working on my website right now with hard coded values for the options instead of the options I’ve mentioned in this comment and my last comment.
November 2nd, 2006 at 22:28
Hi Dave!
I remember you, of course. Thanks for all the feedback and ideas for improvements. It’s really nice to see when people care about the stuff I code in my free time.
I’ve already thought about implementing the Amazon cover lookup and it’s good to see it working :-)
I’ll take a look into it when I have some time on my hands.
Thanks again!
November 10th, 2006 at 16:13
I had a small problem with my version of onAirNow with album cover art support. In my ID3 tags I add a disc number in the album tag for albums that have more than one disc. I do this by adding “(Disc 1)” without the quotes but with the parenthesis to the end of the album tag for tracks from the first disc, “(Disc 2)” for tracks from the second disc, etc. This prevented these albums from showing cover art because, for example, there is no such album called “The Wall (Disc 1)” by the artist “Pink Floyd”. So I added a filter to remove the added text from the tag so the lookup can work properly.
December 4th, 2006 at 17:12
I have created a WordPress plugin that creates a sidebar widget for onAirNow. If you are running the Sidebar Widgets plugin and a widgetized theme (as well as Daniel’s onAirNow plugin) this plugin allow you to add onAirNow to your sidebar by simply dragging and dropping a widget in the admin panel (instead of manually adding PHP code to your theme). I have not made this plugin available on my website yet but will do so shortly.
Daniel – Email me if you’d like me to send this to you.
December 29th, 2006 at 04:28
[...] Changed the plugin used for updating the current song playing in Winamp from NowPlaying to onAirNow. This was done primarily because the old plugin just stopped working. [...]
February 13th, 2007 at 22:54
It’s been a while since the last update but I hope to release the next (widgetized) update soon. Currently my hard drive is breaking and my MBP is going to be repaired.
February 22nd, 2007 at 09:25
[...] onAirNow [...]
February 27th, 2007 at 20:06
[...] Widget Now Available I’ve written before about a plugin called onAirNow. It’s a WordPress plugin that displays information about the song you are currently listening [...]
March 1st, 2007 at 06:02
[...] onAirNow gets information about your currently playing track from a file uploaded via FTP and displays it on your blog. [...]
March 1st, 2007 at 18:36
[...] onAirNow obtiene información acerca de una canción que estas escuchando actualmente, que ha sido cargada via FTP y la despliega en tu blog. [...]
March 1st, 2007 at 22:01
A quick critique of version 1.7:
– Making the title a link changes it’s color and makes it clash with the rest of the titles in my sidebar. I have tried to remove the link (both in the options page and the PHP) but have been unsuccessful. I don’t mind the link but if it’s changing the look and feel of my blog then I want it gone.
– The options page doesn’t discuss how to add the widget (it only describes how to add the code to the template).
– The Amazon album art lookup and linking feature we discussed is not included. I had to add it manually. Not a big deal.
March 1st, 2007 at 22:31
Hi Dave,
widget support is mentioned on the options page, but only briefly. I’ve added a hint to look under Presentation / Sidebar Widgets and also added the description to this site (don’t know why I forgot this).
onairNow 1.7f fixes the bug which prevented the removal of the title link. I’ve only checked and noticed the link was removed on the options page, never actually looked at my blog without the link and then instantly added it again. Sorry! The link is only added as the default title for new users, now.
I’ll look into the Amazon album art lookup for the next release.
March 1st, 2007 at 22:39
[...] On Air Now is a simple plugin which displays the track title and artist name of whatever you are currently listening to on your blog. The look of the plugin is completely customisable to show what you want to display (e.g. track number, title, artist, album etc.) and how you want it to be displayed, via CSS. [...]
March 2nd, 2007 at 08:41
[...] onAirNow zeigt Informationen über den gerade laufenden Song über eine via FTP geuploadete Datei an. [...]
March 11th, 2007 at 01:44
[...] heb ik dat niet allemaal zelf ineengestoken. Ik heb gebruik gemaakt van onAirNow, van WordPress Widgets & van DoSomething – gij kunt het dus [...]
March 15th, 2007 at 05:43
Hello Daniel greetings from China!
Thanks for the great plugin, one question: When I play music in Winamp with the Advanced mIRC plugin it generates an onAirNow.track file in my system’s default text encoding which is gb2312, after uploaded to the specific folder of my WordPress installation those Chinese characters(song titles, artist names…) in .track filecould NOT be read correctly.
Could you give a bit advice on how to set encoding for onAirNow so it may read a non-Western contented .track file?
Thanks in advance, please foward me an email of your reply also.
March 15th, 2007 at 19:21
Hi FLAViEN, I’ve replied to your question/issue via e-mail. I’ll have a look at it and when (if) resolved it will be provided with a new release of onAirNow.
March 27th, 2007 at 16:32
[...] onAirNow gets information about your currently playing track from a file uploaded via FTP and displays it on your blog. [...]
April 22nd, 2007 at 07:20
Hi, I’m trying to use Now Playing 2.1.2 for WinAmp to feed the info to onAirNow. While I save the information in the same way that onAirNow expects it, I’m having trouble with certain songs. For some songs it says that nothing is playing, although the info is there. For these songs, the options page says that either nothing is playing, or the file doesn’t have the information “correctly formatted”. I’ve tracked it down to delete the time value from the onAirNow.track file for these songs. If I alter the update script to not output the time, all songs work, when it outputs the time, some work, but mostly dont. I am thinking that it might be that the time is not formatted in a way that OAN expects. Now Playing outputs time as HH:MM:SS. Times like 00:08:21 work, but 00:02:27 makes OAN think that the file is badly formatted. Any ideas?
April 22nd, 2007 at 07:47
Hi again, I discovered where the error was. OAN wants MM:SS, without the hours. Parsing the time made OAN think that the file was already played, thus equal to idle. I’m converting the time to seconds, as OAN accepts that too. I think you should put these things in the documentation: the time should be in MM:SS or SS format, and the filename shouldn’t contain path information to be parsed correctly if other information is missing. When I feed OAN with full path & filename, the artist is always something like D:\whateverpath\artist ^_^ Still it’s a great plugin, thanks for it.
April 22nd, 2007 at 08:37
Thanks for the feedback Pi!
I’ve changed the documentation to reflect this.
April 24th, 2007 at 03:58
I have yet-another little request for next OAN release: please don’t use camel caps with the file names! Most servers are pesky with case. Following all the other folders, I changed the name of OAN’s folder to ‘onairnow’. That made OAN fail to load the CSS, because you includes caps in the absolute file name of the CSS. Btw, using an absolute path for pointing to the CSS is not such a good idea… For me it didn’t work ^_^ Maybe you should rewrite the CSS detection and inclusion code.
April 24th, 2007 at 13:40
Fixed! I don’t know why I didn’t ask WordPress for the plugin’s directory as I do now in the first place.
I’ve also added support for the song length to be HH:MM:SS, MM:SS or just seconds alongside some other changes you’ve suggested. The next release will follow soon.
May 19th, 2007 at 16:43
[...] onAirNow [...]
June 12th, 2007 at 13:02
[...] onAirNow [...]
June 29th, 2007 at 22:45
Are there any walkthrough’s on how to configure AMIP to work with this, I could really use one.
June 30th, 2007 at 22:14
Hi Angel,
I’m not using AMIP and currently don’t have the time to try it. Maybe the AMIP configurator manual has some useful inofrmation.
July 10th, 2007 at 06:45
[...] Visit [...]
July 26th, 2007 at 11:43
Hi! Thanks for this plugin. Really useful.
July 28th, 2007 at 03:41
[...] onAirNow – Now playing plugin that displays most recent song from iTunes or WinAmp. [...]
July 28th, 2007 at 18:25
[...] onAirNow [...]
July 29th, 2007 at 04:02
Hi, thanks for the great plugin. I’ve integrated a plugin to my mIRC mp3 player to create and upload the file. This is just what the doctor ordered!
Great stuff! Perfect!
btk
July 30th, 2007 at 12:56
[...] Added compatibility for the onAirNow WordPress [...]
July 30th, 2007 at 17:26
[...] onAirNow [...]
August 3rd, 2007 at 04:33
[...] onAirNow – Muestra una lista de lo último que has escuchado en iTunes o Winamp. [...]
August 17th, 2007 at 05:21
[...] onAirNow – Now playing plugin that displays most recent song from iTunes or WinAmp. [...]
September 5th, 2007 at 10:11
[...] список станций, закладки по мелодиям и исполнителям. onAirNow – плагин показывающий самые последние композиции [...]
September 29th, 2007 at 20:05
great! recommended.
October 10th, 2007 at 07:10
[...] onAirNow – 显示iTunes 或 WinAmp的播放列表 [...]
November 4th, 2007 at 20:27
[...] список станций, закладки по мелодиям и исполнителям. onAirNow – плагин показывающий самые последние композиции [...]
March 27th, 2008 at 12:05
[...] onAirNow, apabila anda pengguna iTunes atau WinAmp, maka plugin ini akan memperlihatkan apa yang anda [...]
July 15th, 2008 at 22:24
How to get this working with AMIP – really easy!
Essentially follow this tutorial: http://amip.tools-for.net/oldhelp/web.htm
DO NOT DOWNLOAD cURL with SSL!! This gave me a DLL error, just take a normal WIN 32 generic version.
Then make your in.html (i renamed mine onAirNow.track.temp) look like so:
%1
%2
%4
then change in.html to onAirNow.track.
Modify cUrl command accordingly and your off!
Can be seen in action here: http://www.fieldjournal.co.uk
July 15th, 2008 at 22:25
Oh I should also add! Make all your irc presets contain the commands:
/template:(c:\amipweb\in.html)c:\amipweb\out.html
/exec:(c:\amipweb\curl.exe)-B -T out.html -u : ftp:////
i found that it kept jumping between them, despite random preset wasn’t selected!
July 24th, 2008 at 00:52
[...] onAirNow gets information about your currently playing track from a file uploaded via FTP and displays it on your blog. [...]
July 26th, 2008 at 16:24
[...] onAirNow – Now playing plugin that displays most recent song from iTunes or WinAmp. [...]
October 21st, 2008 at 22:37
Really like this plugin. But I’m having a small problem. I’m getting information other than album info in the output.
Example: ” « by (Album: / 1985) ”
What should I edit and where exactly? Your help would be appreciated.
November 6th, 2008 at 10:22
Please e-mail me directly with more details if you still have problems.
December 22nd, 2008 at 01:46
Hey man thank u for this awesome plugin! I had some problems but after a few hours I’m OK, is working :P Check it at my brand new website. By the way, I managed to make it work by using both dosomething plugin and AMIP. If anyone needs help setting up onAirNow on his/her blog, just let me know and I’ll try to help. Thing is Daniel that I wonder if there’s a way for the plugin to update the media being played in real time, displaying the time and all that?
February 9th, 2010 at 13:44
Love this plug in I had no trouble at all getting it to work. I wonder, though if there is a way to get it to check the file on a timer and update the widget with ajax, maybe. If you’ve tried this could you let me know?
February 16th, 2010 at 18:17
Alec, onAirNow doesn’t support AJAX. The simple reason is I don’t think a visitor is interested in the changing of your currently playing song. Furthermore a visitor most likely won’t view the same page long enough to even encounter the change. This is why I won’t implement a “live refresh” on onAirNow.
April 16th, 2011 at 15:28
Just wanted to drop a note and say thank you. We’re implementing this on our site next week. So far we’ve had no problems!
-Abby