Personal tools

Difference between revisions of "How to get now playing information into a text file"

From Rivendell Wiki

Jump to: navigation, search
(Created page with "'''Q:''' Do you think one of you can 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 c...")
 
(Expanded and updated for Rivendell version 3.)
 
Line 1: Line 1:
'''Q:''' Do you think one of you can walk me through getting RDAirPlay to spit out a now playing.txt so we can feed this info to our website?
+
'''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.
+
'''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>RDAirplay>Configure Now & Next Data>Master Log>RML>''' and enter this:
+
Go to '''RDAdmin'''->'''Manage Hosts'''-> ''select the host'' ->'''Edit'''->'''PyPAD Instances'''
+
 
RN echo %t - %a > /var/web/playing.txt!
+
You’ll see a list of PyPAD instances with (hopefully) green balls indicating that they are running.
+
 
If you want other information other than artist and title change the placeholders. You can even grab info about what will be playing next. See this [[NOW_and_NEXT.txt_-_How_to_get_the_meta-data_about_what_is_playing_and_what_will_play_out_of_Rivendell|wiki page]] for more info about the place holders.
+
[[Image:PyPADList.png|center|thumb|400px|border|PyPAD Instance List]]
 +
 
 +
<div style="clear: both"></div>
 +
 
 +
Click the '''Add''' button to add a new instance. You&rsquo;ll then see the list of available PyPAD scripts. See the [http://opsguide.rivendellaudio.org/html/sect.rdadmin.manage_hosts.html#sect.rdadmin.managing_pypad_instances Ops Guide] for details about what all the scripts do. Choose ''pypad_filewrite.py'' to save the Now &amp; Next data to a file.
 +
 
 +
[[Image:PyPADSelectScript.png|center|thumb|400px|border|PyPAD Instance Selection]]
 +
 
 +
You&rsquo;ll be presented with a window that contains all the (default) data need to save Now &amp; Next data in a file.
 +
 
 +
[[Image:PyPADEditInstance.png|center|thumb|400px|border|PyPAD filewrite Instance Settings]]
 +
 
 +
Most of the contents of this window are comments (lines beginning with a semicolon ('''&#59;''')). 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&rsquo;re done editing the settings. You should now see your new PyPAD instance in the list.
 +
 
 +
[[Image:PyPADList2.png|center|thumb|400px|border|PyPAD Instance List with pypad_filewrite.py]]
 
   
 
   
You will need to make sure that the directory (/var/web in our example) is writable by the Rivendell Linux user so it can write to the file at each audio start. Each time audio starts this file will be overwritten with the info about the current song and possibly the next if you set it up that way.
+
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 audio in groups that are enabled for Now & Next data will be sent to the file. See the section of this [[NOW_and_NEXT.txt_-_How_to_get_the_meta-data_about_what_is_playing_and_what_will_play_out_of_Rivendell|wiki page]] titled [[NOW_and_NEXT.txt_-_How_to_get_the_meta-data_about_what_is_playing_and_what_will_play_out_of_Rivendell|ENABLING AUDIO]].
+
'''Note:''' Only metadata for Carts in Groups that are enabled for Now &amp; Next data will be sent to the file. See the Ops Guide on [http://opsguide.rivendellaudio.org/html/sect.rdadmin.manage_groups.html#sect.rdadmin.manage_groups.editing_group_information Managing Groups] for more details.

Latest revision as of 14:30, 16 September 2020

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 pypad_filewrite.py 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 pypad_filewrite.py

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.