RadioDJ is a really great piece of software for radio station automation. It is fully featured and used all over the world in professional studios. What's even more impressive, is that this software is completely free.
There is a feature whereby RadioDJ can automatically POST details of the currently playing track to a web service, and it is this feature that we've extended to make client-side binding with jQuery much easier. Our web service also keeps history of the recently played tracks. As with RadioDJ itself, we've made our web service free to download and use.
1. Download the webservice zip and copy the entire contents into a folder that IIS can access. Create a new website using this folder as the root directory. It's beyond the scope of these instructions to teach you how to set up a website in IIS, there are plenty of tutorials around on the internet.
2. In RadioDJ, go to 'Now Playing Info' and select the 'Web Export' tab.
3. In the 'URL' box, enter the URL of the webservice you set up in step 1, with '/nowplaying' on the end. For example:
4. In the 'Custom Data' box, enter the following, and don't forget to change the password to something else. The password will be used to protect unauthorized clients from updating your now playing data.
5. Leave the 'method' as 'POST' and ensure 'Enabled' is ticked. Click 'Save'.
6. Open the web.config in the directory you set up in step 1. Change the password so it matches the one you set in step 4. Also, change ArtworkPath to match the location you have set up in RadioDJ.
To test, open the following links in your browser and you should get some JSON back. Note that you won't get anything until RadioDJ posts its first track. Also, if you recycle the app pool, restart IIS, or modify web.config, then you'll lose the history until RadioDJ starts playing a new track.
When hitting /history, you will get back the number of items defined in DefaultHistoryCount in web.config, assuming there are enough items to return. You can also ask for a specific number of items by modifying the URL. For example if you wanted the last 10 played items:
The web service can also return you the artwork, and has built-in resizing functionality. To get the artwork of the currently playing track, without any scaling, hit this URL:
To retrieve a specific artwork image:
You can also scale the image. To return the image as 500 x 250 pixels:
Or to return 300 pixels wide and auto-scale the height:
The easiest way to display artwork on your website is to simply use the ArtworkUrl property in the JSON that is returned by the 'now playing' or 'history' calls. This url is automatically fully qualified. Check out the 'Now Playing' demo for a simple demonstration of how to hook up the web service calls to a web page using jQuery.