Any scripts to show current track/last play tracks?

Steamcast is a stand alone server that combines the features of SHOUTcast and Icecast2 and more to make one mega awesome server.
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Any scripts to show current track/last play tracks?

Post by sound selecta »

Just read up on Steamcast and am thinking of using it instead of Icecast2 I always liked you software/scripts so why not. Are there any ready available php scripts to show the current track and say last 5,10 etc played tracks on a web page? Will scripts designed for Icecast work?

If there are none atm can you gimme an amount in $$$ for how much to write one?

Thanks
Last edited by sound selecta on Tue Dec 02, 2014 12:26 am, edited 1 time in total.
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

There are definitely scripts out there. Stat sheet follows 0.9.75 spec, so anything made for that version should work If you want something custom, contact me in pm and give me specifics of what you need and we can either make it available for the community at no charge or do something for you at a reasonable rate.

Anything that works with Shoutcast 7.html will definitely work but anything made specifically for Icecast 2 will probably not.

I haven't tested it but found https://searchcode.com/codesearch/view/44293203/
- Jay
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

Just whipped this up.

http://www.radiotoolbox.com/steamcast/s ... tream.phps

If you enjoy it and it works for you, feel free to donate to our project at Paypal jay at radiotoolbox.com

Thanks for using Steamcast. Full documentation is provided in the source.
- Jay
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Re: Any scripts to show current track/last play tracks?

Post by sound selecta »

Hi

Thanks

So in order to make this work I just put it into a .php file and I need to change this line in the examle and uncomment the examle code?

$steamcast = new SteamcastStream('http://ice.futureassassin.com:8000/live', 'admin', 'MyPass');
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

yup just copy this code into any file say

steamcaststream.php

then in your php scripts just

Code: Select all

<?php
require_once('steamcaststream.php');
$steamcast = new SteamcastStream('http://ice.futureassassin.com:8000/live', 'admin', 'MyPass');
...
then follow the example and docs after that. All data is available in a simple php array.
- Jay
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Re: Any scripts to show current track/last play tracks?

Post by sound selecta »

Ok so I got a file called index2.php http://futureassassin.com/index2.php

I have this in it

Code: Select all

<?php
require_once('steamcaststream.php');
$steamcast = new SteamcastStream('http://ice.futureassassin.com:8000/live', admin', 'MyPass');
if ($steamcast->retrieve_stats() && $steamcast->has_streams())
{
	$data = $steamcast->stream_info(1);
	if ($data != NULL)
	{
		echo 'Wow, '.$data['name'].' has some shtuff in it!  Currently there are '.$data['nodes'].' listeners!  They are currently hearing '.$data['meta_song'].'';

		while (list($key, $val) = each($data['played']))
		{
			echo '<br> at '.date('r', $val['entry_time']).' we played '.$val['song_title'];
		}
		while (list($key, $val) = each($data['peers']))
		{
			echo '<br> '.$val['ip'].' connected at '.date('r', $val['pconnect_time']).' with '.$val['user_agent'];
		}
	}
	else
	{
		echo 'No Mount by this name!';
	}
}
else
{
	echo "This failed :(";
}

?>
and in steamcaststream.php I have the original code.

I can see the script is accessing the url because if I change the mount url to say http://ice.futureassassin.com:8000 No Mount by this name
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

In your case you will want to use the following connection url

$steamcast = new SteamcastStream('http://ice.futureassassin.com:8000/live.ogg', admin', 'MyPass');

The change is noted in bold.
- Jay
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

I also found one other problem

Change

Code: Select all

$data = $steamcast->stream_info(1);
to

Code: Select all

$data = $steamcast->stream_info();
Since you are referencing the exact stream name in the url you don't need to specify the index. If you did, you would want to use 0 anyways since all indexes are 0 based. So the first stream will always be labeled 0.
- Jay
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Re: Any scripts to show current track/last play tracks?

Post by sound selecta »

Oh that was the issue

$data = $steamcast->stream_info(); not $data = $steamcast->stream_info(1);

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

Re: Any scripts to show current track/last play tracks?

Post by Jay »

I fixed the example as well. That shouldn't have been in there in the first place.
- Jay
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Re: Any scripts to show current track/last play tracks?

Post by sound selecta »

Oh didn't even realise it but its listing the track twice :P but the lines have reversed name - track and tack - name

http://www.futureassassin.com/index2.php
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

When I go there, the page is blank.
- Jay
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Re: Any scripts to show current track/last play tracks?

Post by sound selecta »

Sorry was messing with things its fixed now Im actually seing the same thing here http://ice.futureassassin.com:8000/admi ... m/1/played

3 mins 29 secs ago tripping on sunshine - n zo and dj invincible and ste
3 mins 29 secs ago N Zo And Dj Invincible And Steff - Tripping On Sunshine
9 mins 12 secs ago the vibe - drum and bass
9 mins 13 secs ago Drum and Bass - The Vibe
15 mins 06 secs ago ribbon in the sky - lloydie crucial
15 mins 06 secs ago lloydie crucial - ribbon in the sky
19 mins 04 secs ago remember me (from the bronx) - benny blanco
19 mins 04 secs ago Benny Blanco - Remember Me (From The Bronx)
22 mins 44 secs ago fire - prisoner
22 mins 45 secs ago Prisoner - Fire
26 mins 07 secs ago merder style - bizzy b and peshay
26 mins 07 secs ago Bizzy B and Peshay - Merder Style
30 mins 37 secs ago big up your chest (remix) - ellis d
30 mins 37 secs ago Ellis D - Big Up Your Chest (Remix)
36 mins 00 secs ago armed and dangerous - soundclash
36 mins 01 secs ago Soundclash - Armed and Dangerous
40 mins 51 secs ago cool down - andy c
40 mins 52 secs ago Andy C - Cool Down
47 mins 01 secs ago shes mine (tresspass liick out - barrington levy and mega banto
47 mins 02 secs ago Barrington Levy and Mega Banton - Shes Mine (Tresspass Liick Out)
User avatar
Jay
Will work for food (Administrator)
Posts: 3025
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Any scripts to show current track/last play tracks?

Post by Jay »

Since you are using Ogg you can access the meta elements directly and display them however you like.

Use custom_tags

ex

Code: Select all

      while (list($key, $val) = each($data['played']))
      {
         echo '<br> at '.date('r', $val['entry_time']).' we played '.$val['custom_tags']['title'].' by '.$val['custom_tags']['artist'];
      }
- Jay
sound selecta
Posts: 78
Joined: Tue Jan 15, 2002 4:41 am
Location: Vancouver
Contact:

Re: Any scripts to show current track/last play tracks?

Post by sound selecta »

Hmm same thing but I think something is wrong with the stream anways. Seem to be cutting out at track change through the server index page and cust out w few seconds ater using a local player.
Post Reply