last played

Steamcast is a stand alone server that combines the features of SHOUTcast and Icecast2 and more to make one mega awesome server.
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

last played

Post by stationx »

Hi Guys,

I'm having no end of trouble trying to get the "now playing etc" scripts found (on other posts) to work. I was left wondering if it was me so I dusted off the old radio toolbox (V1) and installed php to my website. It worked first go.

Is there are "php for dummies" zip file handy somewhere for people like me? I had no dramas with the few little things we had to do with catcher.php and config.php from those days. I really liked the example2.php from back then.

I seem to be missing something in today's world.

Regards

Peter
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: last played

Post by Jay »

We need clarification here, are you trying to use Radio Toolbox or Steamcast? You posted to Steamcast but your query seems to be around features of Radio Toolbox.
- Jay
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

Sorry Jay, I'm trying to get the "now playing" scripts that are posted on other topics in the steamcast section to work. The ones that pull from the steamcast server itself... I only used the old radio toolbox v1 as an example of what level i'm at... I'm no code wizz and had no issues getting that old one to work. I'm just stumped with the scripts i'm finding here. I was after a "for dummies" version if you can.. cheers
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: last played

Post by Jay »

Were you using this code?

https://www.radiotoolbox.com/code/steamcaststream

If so you can test to code by uncommenting the lower "example" section.

To uncomment remove

Code: Select all

/*
and

Code: Select all

*/
You will also need to change this line

Code: Select all

$steamcast = new SteamcastStream('mysteamcastserver.com', 'admin', 'mysecretpassword');
Replace mysteamcastserver.com with your steamcast server's base address. (Ex: hostname:8000) Replace admin with your administrative/mount username and the mysecretpassword you can put in your administrative/mount password.

Let me know if you have any other questions.
- Jay
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

All I get is -- this failed :(
Should i see the hits from the script turning up in the server event log? Because I think it isn't hitting the server. I can see radio toolbox turning up in the event log and it is looking at admin/status.xml -- i think your script is looking for json -- if that was the case shouldnt i see something in the event logs of the server like -- resource not found
cheers
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: last played

Post by Jay »

I don't believe weblog is turned on by default. Do you see anything in your error log at your webserver that runs the script?
- Jay
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

Yes.....jay....
Line 88 of the script - says can't load - I'll see if I can copy the error log here for you. It creats a little text file - error_log on the web hosting.
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

[28-Mar-2018 02:18:20 UTC] PHP Warning: file_get_contents(http://oops:8000/admin/status.json): failed to open stream: Connection refused in /home/oops/public_html/oops.com.au/steamcaststream.php on line 88

"oops" = so now one sees the real location posted here -- happy to forward privately if needed to check

cheers
User avatar
Max
Posts: 153
Joined: Fri Oct 21, 2011 1:39 am

Re: last played

Post by Max »

Connection refused implies that PHP cannot communicate with Steamcast. Please ensure your firewall allows your PHP to make external connections on port 8000 TCP. (And that it is the correct port for Steamcast you are running.)

Steamcast itself cannot cause a connection refused. At most it will reply with a 403 Forbidden error if the authentication details are incorrect.
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

I'm confused Max... are you saying the firewall "where the steamcast is" needs to know that php wants to talk to the steamcast server? I did not know you needed to do that as once you opened port 8000 I figured it didn't matter what was on it. Or do you mean the other end "where the script is" on my website host? Because I can confirm the older toolbox v1 way of sending from the toolbox app to the website worked! Plus it still does! Until toolbox v1 gets a touch from your website and gives you the message to upgrade. This is why I pointed this out in my first post. To hopefully show that part works. I know they are different. Which brings me to my next question -- could it be the version of php that my host runs? I'm on 5.4....... cheers peter
User avatar
Max
Posts: 153
Joined: Fri Oct 21, 2011 1:39 am

Re: last played

Post by Max »

Well, I don't honestly know where the block is since I'm not your host provider. But some website hosts prevent PHP from reaching out on non-standard ports. Its actually a default in ConfigServer Firewall to block non-standard outbound ports.

But its obvious from the error you posted something is preventing PHP from communicating with Steamcast, which is most likely a firewall.
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

ok i will investigate on the website host end.... does the fact the new radio toolbox get it's stats from the same steamcast server mean its working on the steamcast server end? it's looking for the same /admin/stats.xml isn't it?
User avatar
Max
Posts: 153
Joined: Fri Oct 21, 2011 1:39 am

Re: last played

Post by Max »

If you enter your login details under the Listener tab in RadioToolbox v2 then yes. RadioToolbox v2 makes the exact same hit request since the admin stats sheet contains listener details.
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

Thanks max..... I'll setup a separate instance of radio toolbox v2 on my office pc here.....then ask it to call for details from the same box i'm trying to point the script at... this will prove the information needed can be seen from the outside world..... currently steamcast and radio toolbox v2 are all on the same box..... calling for stats is about to be done with --localhost used in the dns name....
stationx
Posts: 61
Joined: Sun Dec 28, 2008 9:26 am

Re: last played

Post by stationx »

and the answer is yes -- can be seen from the outside world
Post Reply