Web Hosting Talk







View Full Version : SHOUTcast + PHP


DanMerc
01-09-2005, 10:57 AM
Hey everyone,

I run a radio station, and I want a script that will count how many hours each of my DJ's spend on air.

The station title is always the DJ name, so for example, 'DJ Dan' or 'DJ Ben'. I have seen a SHOUTcast Control Panel that counts how many times a station has broadcasted, I just want to take this a bit further.

------------------------------------------------------------------------------------
MY IDEA AT THE MOMENT

When a DJ connects to the SHOUTcast server, the server opens a URL. The URL being something like 'www.myradio.com/shoutcast.php?dj=$stationname'. That PHP script logs that the DJ has gone on air and makes a timestamp of it. When that DJ disconnects, it runs something like 'myradio.com/shoutcastdc.php' and that script will count how long it has been since they went on.

This is probably more complicated than it needs to be, and if you have any other ways or ideas do let me know!
------------------------------------------------------------------------------------

Thanks for reading! :stickout:

Angelo
01-09-2005, 06:00 PM
Cron job to get the Title Name from the shoutcast XML stats every X minutes and to record it with name/time. And to write a script reading from that record that prints the name and time.

I do not understand your way, when a dj sources the stream how will the server open your php file?

DanMerc
01-09-2005, 06:03 PM
That's what I was also thinking, you'd probably have to edit the server or something.

The cron job idea sounds good, I will go with it and let you know how it goes.

Thanks alot!