Personal tools

How to get now playing information into a text file

From Rivendell Wiki

Jump to: navigation, search

Q: Please walk me through getting RDAirPlay to spit out a now playing.txt so we can feed this info to our website.

A: If you would like to create a playing.txt file in the /var/web directory of the local machine with the song title followed by the artist name separated by a dash you can do the following.

Go to RDAdmin->Manage Hosts-> select the host ->Edit->PyPAD Instances

You’ll see a list of PyPAD instances with (hopefully) green balls indicating that they are running.

PyPAD Instance List

Click the Add button to add a new instance. You’ll then see the list of available PyPAD scripts. See the Ops Guide for details about what all the scripts do. Choose to save the Now & Next data to a file.

PyPAD Instance Selection

You’ll be presented with a window that contains all the (default) data need to save Now & Next data in a file.

PyPAD filewrite Instance Settings

Most of the contents of this window are comments (lines beginning with a semicolon (;)). The lines highlighted in the above screenshot show the items you may want to change. You will probably want to change the Filename setting. Changing the Append from zero to one will cause Rivendell to add new lines each time it writes data to the file. Also look at the FormatString setting and the comments about its wildcards (also known as placeholders).

Click OK when you’re done editing the settings. You should now see your new PyPAD instance in the list.

PyPAD Instance List with

You will need to make sure that the directory (/var/web in our example) is writable by the Linux user pypad so it can write to the file each time a Cart starts playing. Each time RDAirplay starts a Cart, this file will be overwritten (or appended) with the info about the current song and possibly the next if you set it up that way.

Note: Only metadata for Carts in Groups that are enabled for Now & Next data will be sent to the file. See the Ops Guide on Managing Groups for more details.