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:

<?php if (function_exists("onAirNow")) { onAirNow(); } ?>

You may need to surround the above code with <li></li> 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):

<artist>ARTIST_NAME</artist>
<title>SONG_TITLE</title>
<album>ALBUM_NAME</album>
<year>YEAR</year>
<track>TRACK_NUMBER</track>
<time>SONG_LENGTH</time>
<image>COVER_URL</image>
<file>FILENAME</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 <idle> 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 <image> tag).

onAirNow: album name on an extra line

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

Please consider making a donation (sidebar) and linking to my site if you like this plugin!

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…

[Next page]

60 Responses to “onAirNow”

Pages: [1] 2 » Show All

  1. Comment author Website icon Marco Raaphorst says:

    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!

  2. Comment author (post author) Website icon Daniel says:

    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!

  3. Website icon Trackback from BloggingPro China » Blog Archive » WordPress Plugin: onAirNow

    […] onAirNow,在侧栏显示当前本地正播放的音乐详细。 player playlist sidebar […]

  4. Comment author robyn says:

    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!

  5. Comment author (post author) Website icon Daniel says:

    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.

  6. Website icon Trackback from From Song Displayer to onAirNow « A Whole Lot of Nothing

    […] 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. […]

  7. Website icon Trackback from This Blog Right Here

    […] 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) […]

  8. Comment author Lendell Ray says:

    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.

  9. Comment author (post author) Website icon Daniel says:

    Lendell, it’s implemented. Though testing is still to be done. You should have received a beta version via e-mail.

  10. Comment author Ronald says:

    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!

  11. Comment author (post author) Website icon Daniel says:

    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!

  12. Comment author Ronald says:

    Yes I fixed it, see: http://www.popindekop.nl

  13. Trackback from hello, sputnik » Surrounded by brokenness.

    […] 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. […]

  14. Comment author Website icon Dave says:

    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?

  15. Comment author (post author) Website icon Daniel says:

    You have to provide the URL of the cover art. That is your media player plugin’s job. Just surround the URL with <image> and </image> in your onAirNow.track file.

  16. Comment author Website icon Dave says:

    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?

  17. Comment author (post author) Website icon Daniel says:

    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).

  18. Comment author Website icon Dave says:

    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.

  19. Comment author Website icon Dave says:

    I couldn’t get an answer on how to get the Now Playing plugin for Winamp (http://people.cc.jyu.fi/~ltnevala/nowplaying/) spit out the proper URL for album images so I did the next best thing and hacked onAirNow to do the lookup itself. As you know, this is not the first time I hacked this plugin for my purposes (I’m the same guy who hacked the plugin for my streaming MP3 player issue which led you to introduce the pattern matching feature).

    In this case I added an IF statement that says if there is nothing in $trackInfo[’image’] but $options[’showImage’] is selected then use Amazon Web Services to look up the album cover and display it. This requires the user to signup for Amazon Web Services and enter their accesskey.

    If you integrate this feature into the plugin you’d need to add 2 options. One for if the user would like to use the feature. The other to hold the usrers accesskey.

    The next step for me is to make the album cover link to the product page on Amazon (using my Amazon Associates account) so someone browsing my blog can buy the album through it.

    To see this in action try viewing my website (http://nothing.golddave.com). If I’m listening to music you should see an album cover (provided my ID3 tags match Amazons album titles).

    PS - This works with standard ID3 tags as well as with pattern matching.

  20. Comment author Website icon Dave says:

    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.

  21. Comment author (post author) Website icon Daniel says:

    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!

  22. Comment author Website icon Dave says:

    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.

  23. Comment author Website icon Dave says:

    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.

  24. Trackback from 9lb hammer»Blog Archive » Not forever, just for now

    […] 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. […]

  25. Comment author (post author) Website icon Daniel says:

    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.

  26. Trackback from Julius Sison » Blog Archive » Audio Plugins for WordPress

    […] onAirNow […]

  27. Website icon Trackback from onAirNow Widget Now Available « A Whole Lot of Nothing

    […] 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 […]

  28. Website icon Trackback from Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 3/01

    […] onAirNow gets information about your currently playing track from a file uploaded via FTP and displays it on your blog. […]

  29. Website icon Trackback from WeblogToolsCollection Español » Blog Archive » Plugins de WordPress publicados 1/3

    […] 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. […]

  30. Comment author Website icon Dave says:

    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.

  31. Comment author (post author) Website icon Daniel says:

    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.

  32. Trackback from Plugin: Display “Now Playing” Song | Wordpress Tutorials And Blogging Tips

    […] 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. […]

  33. Website icon Trackback from WeblogToolsCollection DE » Blog Archive » WordPress Plugin Veröffentlichungen am 3.1.

    […] onAirNow zeigt Informationen über den gerade laufenden Song über eine via FTP geuploadete Datei an. […]

  34. Trackback from joszijnsite » Musiks!

    […] heb ik dat niet allemaal zelf ineengestoken. Ik heb gebruik gemaakt van onAirNow, van WordPress Widgets & van DoSomething - gij kunt het dus […]

  35. Comment author FLAViEN says:

    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.

  36. Comment author (post author) Website icon Daniel says:

    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.

  37. Website icon Trackback from WordPress Plugins for March 27, 2007 « designcreatology

    […] onAirNow gets information about your currently playing track from a file uploaded via FTP and displays it on your blog. […]

  38. Comment author Pi says:

    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?

  39. Comment author Pi says:

    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.

  40. Comment author (post author) Website icon Daniel says:

    Thanks for the feedback Pi!
    I’ve changed the documentation to reflect this.

  41. Comment author Pi says:

    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.

  42. Comment author (post author) Website icon Daniel says:

    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.

  43. Trackback from Audio plugins for WordPress

    […] onAirNow  […]

  44. Trackback from Blog & WordPress » Audio plugins for WordPress

    […] onAirNow […]

  45. Comment author Website icon Angel says:

    Are there any walkthrough’s on how to configure AMIP to work with this, I could really use one.

  46. Comment author (post author) Website icon Daniel says:

    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.

  47. Trackback from WP Plugins DB » Plugin Details » onAirNow

    […] Visit […]

  48. Comment author Website icon Martino says:

    Hi! Thanks for this plugin. Really useful.

  49. Website icon Trackback from 50+ WordPress Plugins for Multimedia

    […] onAirNow – Now playing plugin that displays most recent song from iTunes or WinAmp. […]

  50. Website icon Trackback from 50+ Plugins de Wordpress para Multimedia « Quest’s Blog

    […] onAirNow […]

Pages: [1] 2 » Show All

Leave a Comment!

By submitting a comment you agree that your comment may appear on this site and that your e-mail address and IP address will be saved on the server (but are not publicly viewable).


105 posts. 13 pages. 223 comments. 37 categories. 82 queries. 0.462 seconds.
Blog © 2005-2008 Daniel Gattermann. Logos, trademarks, etc. © by their respective owners.