[Web site] Show current track title, cover art, recent tracks

djsoft

Well-known member
Staff member
The script will show currently playing track title along with its cover art. Also shows recently played tracks.

How to use

1. Install the script on your web site

Download the attached nowplaying.zip and upload files from the archive to your web site. Files must be uploaded to a folder accessible publicly from the web - e.g. public_html, www.

2. Create HTTP request in RadioBOSS
- Open the Settings window, navigate to Reports
- Check the Enable notifications checkbox
- Enable the Save artwork option to make RadioBOSS export the artwork information (otherwise the %artwork variable used in the HTTP request will not work)
- Add new request using the + button and enter the following URL (replace the web site address)
Code:
http://www.yoursite.com/nowplaying/nowplaying.php?casttitle=%casttitle&artwork=%artwork&key=TB21Dr3km
- Change the Method to POST.

Please see this link for more info about using notifications in RadioBOSS: https://manual.djsoft.net/radioboss/en/http_request.htm

3. See it in action
Start playback in RadioBOSS to make it send the playing track info to the script.
Navigate to http://www.yoursite.com/nowplaying.html you should see the title and album cover displayed (see the image attached).
The nowplaying.html is an example on how the data is displayed. You can copy parts from it to your real web site pages to display the data where needed.

Security
Once everything works, change the script access key ($key) in nowplaying.php and enter the new access key in HTTP request in RadioBOSS (the &key= parameter in the URL).
Access key makes sure that only allowed requests will come through.

Troubleshooting
If you see error 500 in RadioBOSS with message like "Failed to write to a file", it probably means the script does not have permission to save data to files. You should allow write permission for the following files:
- nowplaying_artwork.png
- nowplaying_title.txt
mode 666 should work, you can also try 755 or 777.
 

Attachments

  • example.png
    example.png
    279 KB · Views: 36
  • nowplaying.zip
    2.1 KB · Views: 32
Last edited:

jopara

Member
Hello again.
I'm trying this new script and it's great to insert the coverart of our musical themes. Now, I would like to make some considerations.
1.- It is good to be able to add your own coverart to each musical theme (tired, but it can be done little by little). Now, is it possible to do it automatically? It is interesting for coverart that do not contain, put the logo. Well with the option that is already enabled or to each audio track separately.
2.- Interesting to have the songs that have sounded, but why not also add the ones that will sound?
Thank you
 

djsoft

Well-known member
Staff member
jopara said:
1.- It is good to be able to add your own coverart to each musical theme (tired, but it can be done little by little). Now, is it possible to do it automatically? It is interesting for coverart that do not contain, put the logo. Well with the option that is already enabled or to each audio track separately.
It is possible to use the default cover art, in RadioBOSS  5.9 it is configured in Settings->Reports->Default artwork. It will use this artwork for tracks that do not have artwork.

jopara said:
2.- Interesting to have the songs that have sounded, but why not also add the ones that will sound?
RadioBOSS only knows the next track and it does not process the playlist further than that. It will only be possible to display the next track title (with little script addition). But there is a problem involved: this way, it will also announce jingles and other items as well (the next track does not perform filtering).
 

BFM

New member
Hi,

Is it possible to edit this script that would display only one title of the next song?  Since i saw it through the API function it is possible to display artwork of the next song (ACTION: nexttrackartworkbut) but there are nowhere to display the title of the next song, so this turns out to be useless!

RadioBOSS only knows the next track and it does not process the playlist further than that. It will only be possible to display the next track title (with little script addition). But there is a problem involved: this way, it will also announce jingles and other items as well (the next track does not perform filtering).
 

Attachments

  • Opera Snapshot_2019-11-30_181730_manual.djsoft.net.png
    Opera Snapshot_2019-11-30_181730_manual.djsoft.net.png
    39.2 KB · Views: 837

djsoft

Well-known member
Staff member
This script does not use the API, it uses nowplaying notifications: https://manual.djsoft.net/radioboss/en/http_request.htm

You can extend it to include the next song information, add parameter to the request, e.g. &next=%nextsong then read and display $_REQUEST['next'] in the script, similar to how it treats artist/title.

If you use the API, next track information is included in playbackinfo.
 

BFM

New member
djsoft said:
You can extend it to include the next song information, add parameter to the request, e.g. &next=%nextsong then read and display $_REQUEST['next'] in the script, similar to how it treats artist/title.

Will that prevent jingles from appearing instead of song names??
 

BFM

New member
I added this in php script:
Code:
$max_next = 1;
$nextsong = $_REQUEST['next'];
$n = htmlspecialchars($nextsong);
$file2 = 'nextplaying.txt';

$next = file($file2, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$next = array_slice($next, 0, $max_next);

$r2 = fopen($file2, 'wb');
if ($r2 !== false) {
    fwrite($r2, $n . "\n");
    foreach ($next as $s2) {
        fwrite($r2, $s2 . "\n");
    }
    fclose($r2);
} else {
    ReturnError(500, 'Failed to write title to a file');
}

But in nextplaying.txt I only received %nextsong?  I also added in the link &next=%nextsong&key=.. What's wrong?
 

djsoft

Well-known member
Staff member
BFM said:
But in nextplaying.txt I only received %nextsong?  I also added in the link &next=%nextsong&key=.. What's wrong?
Please try updating to RadioBOSS 5.9.
 

DJ Denise

Member
Hi BFM,  what privileges does this need on a host server please. I looks like you need to be able to write to the web server  and run active server pages so it would require writable access to the server?
 

jopara

Member
Hi.
Now, I have a delay in the straming server of about ten seconds with respect to the broadcast, with which the cover and the title / artist come out before it starts playing in the reproducer.
Is it possible to match the beginning of the song with the cover and the title / artist?
Thank you
 

djsoft

Well-known member
Staff member
jopara said:
Now, I have a delay in the straming server of about ten seconds with respect to the broadcast, with which the cover and the title / artist come out before it starts playing in the reproducer.
Is it possible to match the beginning of the song with the cover and the title / artist?
Currently this is not supported, I'm sorry. If you're familiar with PHP programming language, you can try introducing a delay in the script.
 

zacgu

New member
I keep getting this error: HTTP Request (#3) error: HTTP/1.1 503 Service Unavailable. Also where do I change Method to POST? Please advise. Thank you
 

zacgu

New member
Okay, got it working. Except for the artwork. Went through all the permissions settings. Any ideas?  :-\
 

Attachments

  • Capture.JPG
    Capture.JPG
    31 KB · Views: 627

djsoft

Well-known member
Staff member
You need to use RadioBOSS 5.9 or newer and switch HTTP request method to POST, the option does not exist in the older versions and without it artwork will not work.
 

DJ Denise

Member
I must be doing something wrong  created a somee website and added the files from the zip to its newly created website. deniserose.somee.com/

It seems not to transfer the graphic image or the track info Radioboss 5.9.30 is set in options reports to  www.deniserose.somee.com/nowplaying.php?artist=%artist&title=%title&artwork=%artwork&key=TB21Dr3km as below

https://gyazo.com/4e04807deb3b699890d36e8cd6af5fb2
4e04807deb3b699890d36e8cd6af5fb2.png


My page is returned as follows:
https://gyazo.com/4ff3374a401ab78896ef9dffe26d0c15
4ff3374a401ab78896ef9dffe26d0c15.png


Does anyone know why please? As i get no error! its runing on aSP 4.0- 4.8  but i can run it on Nectcore 2.2 or 2.0, 3.0, 3.5 any ideas please?

When I run the link for the register of the data www.deniserose.somee.com/nowplaying.php?artist=%artist&title=%title&artwork=%artwork&key=TB21Dr3km i recieve and error HTTP Error 404.3

Thanks for looking Denise?
 

Attachments

  • 4e04807deb3b699890d36e8cd6af5fb2.png
    4e04807deb3b699890d36e8cd6af5fb2.png
    22.7 KB · Views: 312
  • 4ff3374a401ab78896ef9dffe26d0c15.png
    4ff3374a401ab78896ef9dffe26d0c15.png
    9.9 KB · Views: 310

djsoft

Well-known member
Staff member
DJ Denise said:
When I run the link for the register of the data www.deniserose.somee.com/nowplaying.php?artist=%artist&title=%title&artwork=%artwork&key=TB21Dr3km i recieve and error HTTP Error 404.3
This explains why it doesn't work - the file is not found. Also make sure that the server where you have uploaoded it supports PHP.
 

DJ Denise

Member
Hi there thanks so much for your answer. I have tried with another provider and can get %artist-%Title into the file I just cant seem to get the output to trigger from Radio Boss . Do I need the event-logger or other part cant remember the name  that logs the music being played to get the report service to work please? I think the other provider is not running php
 

djsoft

Well-known member
Staff member
The first post describes all the steps you need to to to make it work. If it still doesn't work you should diagnnose what fails, e.g. check the temporary file if it actually contains track title, check if there are error messages in RadioBOSS when it sends track info etc.
 
Top