Icecast Total Hours Script
Hey,
I’ve had some interest in my icecast script over at the SRA forums, so I thought i’d post it here so that anyone who cares can read and do what they want with it!
This is my listener_join.php:
http://brettjenkins.co.uk/code/icecast/listener_join.txt
This is listener_leave.php:
http://brettjenkins.co.uk/code/icecast/listener_leave.txt
This is the SQL database structure:
CREATE TABLE IF NOT EXISTS `icecast` (
`id` int(11) NOT NULL auto_increment,
`icecast_id` int(11) NOT NULL,
`datetime_start` datetime NOT NULL,
`datetime_end` datetime default NULL,
`ip` varchar(20) NOT NULL,
`mount` varchar(20) NOT NULL,
`duration` int(11) default NULL,
`agent` varchar(200) default NULL,
`server` varchar(50) default NULL,
`port` int(11) default NULL,
`user` varchar(20) default NULL,
`pass` varchar(20) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3087 ;
Some of the code probably isn’t as efficient as it could be, and if you want to tidy it up yourself thats cool, but I just programmed this fast.
This is a template for the icecast.xml file in the icecast server directory:
http://brettjenkins.co.uk/code/icecast.xml
Thats the backend sorted, there needs to be a front end to display the data, this is our main frontend stuff:
http://brettjenkins.co.uk/code/icecast-admin/
I’ll just repeat that most of this was programmed quickly and wasn’t necessarily programmed with best practise in mind – the front end is very basic and there is a lot of scope for improvement if someone wanted to improve it.
Hope this helps!
P.S. Big thanks to the SRA for nominating me/xtreme for Best Technical Achievement Award