Old 18th August 2017, 20:35   #1
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
Help with Script

I have a script which lists the listeners on all my streams but it was designed to collect stats for Shoutcast V1.

Can anyone tell me what needs changing to make it work with Shoutcast 2 please:

$serv["name"][] = "192kbps - Trance"; # short nickname of server.
$serv["host"][] = "xxx.xxx.xxx.xxx"; # host address # port IP address
$serv["port"][] = "8030"; # port number
$serv["passwd"][] = "xxxxx"; # admin password

Many thanks in advance

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 19th August 2017, 00:35   #2
djSpinnerCee
Forum King
 
djSpinnerCee's Avatar
 
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,422
Send a message via ICQ to djSpinnerCee Send a message via AIM to djSpinnerCee
you may want to post some of the script - most of the infomation in a v2 server is found in the same place as in a v1, but you may need to add support for the streamid in your script.

what language is your script written?

btw: you should never need the pasword to get listeners (or track title, or stream name, etc...) - that comes from the dnas public pages (index.html, stats, 7.html...).

Last edited by djSpinnerCee; 19th August 2017 at 00:36. Reason: typo
djSpinnerCee is online now   Reply With Quote
Old 19th August 2017, 00:52   #3
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
Here you go:

<?

# name of station
$streamname = "1Mix Radio Trance"; #Put your stream name here

# number of songs to show.
$songhistorylimit = 20;

# Top n Countries
$countrylimit = 50;

# path of GeoIP.dat
$geoip_path = ".";

# sort floating nav menu
# 0 = OFF, 1 = sort by current listener and max slot
$sort_navmenu = 1;

# server config; you can add as many servers as you want in following format
# FR1 Hub
$serv["name"][] = "192kbps - Trance"; # short nickname of server.
$serv["host"][] = "xxxxxx"; # host address # port IP address
$serv["port"][] = "8030"; # port number
$serv["passwd"][] = "xxxxxx"; # admin password

?>

I've been using it for many years and I've forgotten where I found it now..
Attached Thumbnails
Click image for larger version

Name:	Dump.jpg
Views:	63
Size:	239.6 KB
ID:	53476  

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 19th August 2017, 20:46   #4
djSpinnerCee
Forum King
 
djSpinnerCee's Avatar
 
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,422
Send a message via ICQ to djSpinnerCee Send a message via AIM to djSpinnerCee
ok - now i see why you need the stream password -- to get the listener table ... so your script is getting the admin xml most likely. in any event, you've only posted the config script -- to get your script fixed, you can post the entire script (or set of scripts) if you want someone here to tweak it for you. the specific config info is not required, but at least replace them with dummy values.
djSpinnerCee is online now   Reply With Quote
Old 19th August 2017, 21:39   #5
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
OK, I've cleaned out the details relating to my station and attached a zip of the files.

There are other issues with the script but in general it gives me what I need, but it doesn't work with V2.

I hope it can be fixed easily

I tried to upload it as a ZIP file bout it wouldn't let me https://1drv.ms/u/s!Asny6aInDnFZqGvzGmzt3bwBQuiy

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 20th August 2017, 21:24   #6
djSpinnerCee
Forum King
 
djSpinnerCee's Avatar
 
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,422
Send a message via ICQ to djSpinnerCee Send a message via AIM to djSpinnerCee
changes made to three files - i changed their names so you can install them alongside the originals.

shoutcast-config2.php -- the config file -- the only addition was to add an sid parameter to the $serv[] array:

$serv["sid"][] = "1"; // v2 sid - when > 0 indicates a v2 dnas, 0= v1 dnas.

status-shoutcast2.php - the main prog, it will call shoutcast-config2.php and

dat/shoutcast.class2.php --- make sure this is in the dat/ folder.

i too had trouble attaching a zip, so

http://djspinnercee.servemp3.com:114...shoutcast2.zip -- just the three changed files

http://djspinnercee.servemp3.com:114...ges/trance.zip --the full (unmodified) original package as .zip

if you have trouble with these, i can post them on my google drive.
djSpinnerCee is online now   Reply With Quote
Old 21st August 2017, 01:59   #7
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
djSpinnerCee - your an absolute star!

Thank you so much for your work on this and hopefully it will also benefit the wider community..

I'm now in the process of renaming the flags to UPPER case so they all show correctly - if anyone knows how to batch rename a load of gifs from gb.gif to GB.GIF that will save some time

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Site Design

Tags
admin.cgi viewxml, php

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump