Internet Radio Now Playing To Twitter

SPlistStudio

SPlistStudio

[NOTE: This method is now defunct, due to the Twitterfeed service having shut down.]

Let’s talk about getting your Internet radio station’s “Now Playing” information posted to Twitter, in a way that doesn’t cost anything and won’t risk your account getting removed. In this posting the process of creating an XML file, posting it to an external server and getting the information posted to Twitter will be covered.

Most all Internet radio stations have the ability to show the listener what they are listening to by including specific data in the stream. Some automation software may, also, make this and additional data available for other purposes. In most cases, this data may include the item currently playing along with previously played audio tracks. In some systems, one might be able to include what item is coming up next.

Every automation application will produce this information using different methods. For the examples in this tutorial StationPlaylist Studio Pro will be used. StationPlaylist Studio Pro will be creating an XML file that can be parsed. An online service called “Twitter Feed” will also be used, to post portions of the XML file, to create the Twitter post.

To create the XML file, one will need to open the Options menu selection, beneath the View menu of StationPlaylist Studio Pro. Once open, the Now Playing selection, on the left-hand pane, needs to be selected. Within the first tab, of this screen, the available parameters are shown.

StationPlaylist Studio Pro has a number of options available to produce its “Now Playing” information. A full listing of what might be included and the parameters used to create it can be found within the software and the accompanying “Help” files. For the examples used here the Song Artist (%a), Song Title (%T) and Date (%d) and Time (%h) parameters will be used. In addition, parameter settings to show previous track information (%1…) will also be used.

Date Format: ddd, dd mmm yyyy
Time Format: hh:mm:ss

From within the first tab of the Now Playing selection, one will need to ensure that the Date and Time Format areas are set properly.  The format used is as follows:

It is important that the formatting of the date an time are the same as those above.  Without proper formatting the XML file will not be able to display the proper play times for the music included in the Now Playing file.

Once the time and date formats are set, select the File Output tab. From this tab, the XML file template can be selected and edited, the output filename can be set and the FTP settings can be entered.  If one does not have access to an external web site, or FTP location, on which to store the file, SPL includes a mini web server that can do the job, providing that your router is properly configured to allow the external service used to publish the file to Twitter.

Within the File Output tab, select the NPXML.xml file from the Template list.  This selection is a simple, validated XML file that will work with Twitter Feed.  If you wish to modify this file do so carefully.  If the NPXML.xml selection is not available you can select an modify the Sample.xml file.

The format of the file complies with the RSS standards.

XML

The lines of interest in this file are as follows:

  • The first <title> tag is used to reflect the name of your Internet radio station.
  • The first <description> tag is used to describe the contents of the file itself.
  • The first <link> tag is contains the URL for your radio station web site.
  • The second <title> tag contains the “now playing” item on the station. It is formatted as “title by artist.”  This will be included in the Twitter post.
  • The second <description> tag contains a link to your station page, which will be included in the Twitter post.
  • The first <pubDate> tag contains the time and date of the Now Playing item.
  • The third <title> tag indicates the 1st previously played item. This will not appear in the Twitter post and is used to indicate there is a new item in the post.
  • The third <description> tag is the URL of your station and is optional. It is included for completeness. It is not included in the Twitter post.
  • The second <pubDate> indicates the date and time at which the previous item was played on your station. It is not included in the Twitter post.

There are a couple of caveats one needs to know, if one considers editing the file to include additional information.  Twitter Feed expect any <link> for any item within the file to be unique.  This is the reason that the <description> is used for links to the station page.

If you consider using a service other than Twitter Feed they may have different requirements for RSS feeds.  For example, the popular If This Then That service requires that a valid <guid> tag be used.  The <guid> tag must also be unique for every item within the file.  At present, StationPlaylist Studio Pro does not generate any <guid> for inclusion within the XML file.

You will need to modify the template for include information for your station.  The first <title> tag, while required it is not actively used, should be edited to include your station name.  The first <link> tag, along with all <description> tags, should reflect your station URL.  Lastly, but importantly, the time zone designation should be edited to reflect your time zone.  In the example it is set to reflect Central Standard Time.

The sample file will create an RSS feed that looks like the following:

playingnow

This file will need to be uploaded somewhere that is accessible from the Internet.  In this example it will be uploaded, via FTP, to a web server.  The next step is to configure the FTP settings that will allow this action.  Alternatively, you may be able to use the mini web server built into SPL.

Within the File Output tab, locate the FTP Settings and complete it, as required.  In most cases, one will need to complete the Server/IP, Path, Username and Password sections.  These will be unique for everyone.  If you do not know the setting you require contact your web server administrator for assistance.  Generally the Port section will not need to be changed.  Nor will the Passive or Secure checkboxes.

Once these settings have been made, the Options window may be closed.  At this point, if all settings are correct, StationPlaylist Studio Pro will create and publish, to the location specified on the web server, a file called “playingnow.xml,” which looks like the above item.  This file will be updated each time StationPlaylist Studio Pro plays a new song and will be used by Twitter Feed to create the post for Twitter.

If you are using the included mini web server of SPL, you can disregard the FTP settings.  However, you may need to configure your router to forward specific ports, allowing the mini web server and ‘playingnow.xml’ file to be accessed by Twitter Feed, as mentioned next.  Additionally, you will either, need a static IP address, provided by your Internet Service Provider (ISP), or use a Dynamic Domain Name Server (DDNS) service allowing external entities (in this case Twitter Feed) to access the mini web server.  The setup and use of DDNS services is beyond the scope of this document.

The last step is to create your Twitter Feed account and configure the account to grab the information and post the Now Playing information to Twitter.

Once you have created your account at Twitter Feed (http://twitterfeed.com), you will want to create a new feed, by selecting the “Create New Feed” button.

At this point, you will be asked to provide the feed a name.  You will then need to enter the RSS feed URL.  The feed URL will likely be something similar to: http://www.myserver.com/playingnow.xml.  It is recommended that you select the “test rss feed” button to verify that the feed format it correct.  If you are using SPL’s build in mini web server with a static IP, your feed URL appear similar to http://123.45.67.8/playingnow.xml.

Ensure that the Active checkbox is selected.  Next, select that Advanced Settings selection.  This is where the Update Frequency, post content and service options will be selected.  It should be noted that in addition to Twitter, Twitter Feed allows posts to be made to Facebook and Linked in.

To keep yourself out of trouble, it is recommended that the Update Frequency be set to no less than 1 hour and 1 new update(s) at a time.

The Post Content should only include “title and description.”  Make sure that the Post Link checkbox is NOT selected.  If it remains selected the service will look for unique <link> tags for each <item> entry within the RSS file.

You can select the link shortener of your choice.

Within the Post construction area of the page, set the Post Sorting drop down box to pubDate.  For simplicity purposes, the Post Prefix may be set to #NowPlaying (which is a valid Twitter Hashtag).  The suffix can be anything you’d like. I’d recommend using a unique hashtag associate with your station (i.e., #mystation).

The Keyword Filter section is not used.

Once you’ve completed the page, select “Continue to Step 2,” and select the services to which you would like your Now Playing information to be posted on.  During the selection process you will be asked to authenticate to the service (oAuth method) and once completed, click the “All Done” selection.

At this point, if everything worked properly, you should begin seeing Now Playing information being posted to the services you selected.  It may be anywhere from 3 minutes to 2 hours before the first post appears.

When your posts begin to appear they will look similar to the following:

nowplaying post