Download.CV

pdf icon 


Twitter.Updates

What happened last night, stays there... P.s sorry for the guys and girls I hugged many times, was ever so slighty drunk...
1 day, 4 hours ago

Haha I correctly guessed the lead act and the MJ tribute for the summer ball, I'm soo excited for MJ!!! ehhhh heeee :)
2 days, 4 hours ago

Me on Twitter

Listening.To

Current Status:
Not Playing Music
Fall Out Boy
This Ain't A Scene, It's An Arms Race

22 hours, 40 minutes ago
Jonathan Larson
Seasons of Love

22 hours, 45 minutes ago
Martika
Toy Soldiers

2 days, 16 hours ago
This info should never be more than 60secs out of date.
Me on Last.FM

Blog.Subscription

Blog.Menu


 

October 8, 2009

Icecast Total Hours Script

Filed under: Technology, Website, radio — Tags: , , ,
Posted by: Brett Jenkins @ 3:35 pm

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 :)


Contact.Me

If you like what you see, and wish to contact me then please do so! My e-mail address is brett@brettjenkins.co.uk.