• English
  • Deutsch
  • Español
  • Русский
Professional Radio Automation at a price you can afford.Professional Radio Automation at a price you can afford.
RadioBOSS box
RadioBOSS makes automating your broadcast to the world, your business or shop professional, simple, affordable, reliable.

Author Topic: [Web site] Show current track title, cover art, recent tracks  (Read 326 times)

0 Members and 1 Guest are viewing this topic.

djsoft

  • Administrator
  • Posts: 9819
    • http://www.djsoft.net
[Web site] Show current track title, cover art, recent tracks
« on: November 25, 2019, 05:15:14 AM »
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: [Select]
http://www.yoursite.com/nowplaying.php?artist=%artist&title=%title&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.
« Last Edit: November 26, 2019, 07:24:10 AM by djsoft »
Dmitry  •  DJSoft.Net Team  •  Email: support@djsoft.net

jopara

  • Posts: 58
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #1 on: November 26, 2019, 01:20:46 PM »
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

  • Administrator
  • Posts: 9819
    • http://www.djsoft.net
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #2 on: November 27, 2019, 07:38:35 AM »
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.

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).
Dmitry  •  DJSoft.Net Team  •  Email: support@djsoft.net

BFM

  • Posts: 3
    • BFM Radio
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #3 on: November 30, 2019, 12:18:20 PM »
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!

Quote (selected)
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).

djsoft

  • Administrator
  • Posts: 9819
    • http://www.djsoft.net
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #4 on: December 01, 2019, 05:13:38 AM »
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.
Dmitry  •  DJSoft.Net Team  •  Email: support@djsoft.net

BFM

  • Posts: 3
    • BFM Radio
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #5 on: December 01, 2019, 05:19:01 AM »
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

  • Posts: 3
    • BFM Radio
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #6 on: December 01, 2019, 06:11:17 AM »
I added this in php script:
Code: newbielink:javascript:void(0); [nonactive]
$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?
« Last Edit: December 01, 2019, 06:45:30 AM by BFM »

djsoft

  • Administrator
  • Posts: 9819
    • http://www.djsoft.net
Re: [Web site] Show current track title, cover art, recent tracks
« Reply #7 on: December 01, 2019, 08:07:14 AM »
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.
Dmitry  •  DJSoft.Net Team  •  Email: support@djsoft.net