How can I get the title of the current playlist on my website?

You have a question or need an advice about how to do something? Ask it here!
XTended
How can I get the title of the current playlist on my website?

Post by XTended »

Hi Bernd,

How can I get the title of the current playlist on my website?
For example, at this moment the 'dance-classics' playlist is playing.
Like to have 'dance-classics' on my website.

Can I do that with 'PLS_CURRENT_FILENAME_GET' ?

I guess it's something like this:

PLS_CURRENT_FILENAME_GET D:\Websites\XTended\widget-playlist.php|D:\Websites\XTended\nowplaying.php
EXEC_UPLOAD_FILE D:\Websites\XTended\widget-playlist.php|ftp://server25.hosting2go.nl/httpdocs/w ... e|password

Is this the way to do, or am I completely wrong?
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: How can I get the title of the current playlist on my website?

Post by radio42 »

Yes, you are wrong, as the PLS_CURRENT_FILENAME_GET is a command to return the current playlist filename. But this value is not stored anywhere, a such it can only be used in a TCP interface.

You can use the ${cplname} or the ${plsname} macro to retrieve the name of the current playlist.
E.g. use this macro in your nowplaying.php template file.
Or use it in a EXEC_SEND_HTTP_GET command to submit it directly to your web-site...
XTended
Re: How can I get the title of the current playlist on my website?

Post by XTended »

So I have to create it like this:

EXEC_SEND_HTTP_GET ${plsname} D:\Websites\XTended\widget-playlist.php|D:\Websites\XTended\nowplaying.php
EXEC_UPLOAD_FILE ${plsname} D:\Websites\XTended\widget-playlist.php|ftp://server25.hosting2go.nl/httpdocs/w ... e|password
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: How can I get the title of the current playlist on my website?

Post by radio42 »

No!?

Please take a look to the User Manual's Appendix what the control-commands resp. macros actually do.
EXEC_SEND_HTTP_GET sends certain data to a given URL, e.g. a php script - so your example doesn't do that.
The php script then on the server side might evaluate this data and process it further.

How do you today send your song-title info to the server?

Also see these threads:
viewtopic.php?f=9&t=759
XTended
Re: How can I get the title of the current playlist on my website?

Post by XTended »

I send my song-title info to the server with this command (the way you teach me):

OnSongTitleChanged -> EXEC_WRITE_PLAYLISTFILE D:\Websites\XTended\nowplaying\widget-nowplaying.php|D:\Websites\XTended\nowplaying\nowplaying.php
EXEC_UPLOAD_FILE D:\Websites\XTended\nowplaying\widget-nowplaying.php|ftp://server25.hosting2go.nl/httpdocs/w ... e|password
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: How can I get the title of the current playlist on my website?

Post by radio42 »

As said initially you can use the named macros than inside your nowplaying.php file like all the other macros you are alread using inside it.
XTended
Re: How can I get the title of the current playlist on my website?

Post by XTended »

Sorry for not understanding you.
The playlist name is not transfering at the same time as the nowplaying info, cause when I look inside my nowplaying.php file no current playlist is written there <p>Schedule: ${plsname}</p>
Bernd, can you give me a little bit more info how to get that current playing playlist name on my site?
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: How can I get the title of the current playlist on my website?

Post by radio42 »

Please try the ${cplname} macro instead.
XTended
Re: How can I get the title of the current playlist on my website?

Post by XTended »

In the nowplaying.php file I have both macros now: <h3>Schedule: ${plsname}&nbsp;${cplname}</h3> but nothing happened.
Check online: https://xtendedradio.com/listenlive.php (nowplaying.php is an include).
Has it something to do with exclusions, now only music is active, see attachment.[attachment=0]PF-events.jpg[/attachment]

Post Reply