2010
03.02

Crash course

The blog has been a bit quiet this last month, but I’ve been very busy. Got addicted to “The Saboteur” which I might review another time, been watching a lot of Phillip K. Dick movie adaptations and I’ve had to quickly learn to do some quick and dirty web-development.

Basically, we have this internet radio station at work. It’s running Debian as an OS, Icecast as the streaming server, Liquidsoap running the playlist and Joomla powering the website.

Liquidsoap has a telnet interface mainly so you can push song requests into the playlist. I’ve got cron jobs pushing commercials and the occasional prerecorded show, but I needed a way to push song requests via the web. With some php hacking I made a page that made a list of song names and when you clicked on them, javascript popped up another page with some php that injected the URI for the song into liquidsoap.

Next I integrated this into Joomla, bolted onto a shoutbox module. It’s ugly but it works enough. A chat message is sent to the shoutbox indicating what song has just been pushed and who has done it.

The way I have done it is flawed. Every time the page refreshes, the server is running a “find” command on the filesystem. That keeps it up to date but if the list of songs (and users) grows then it could go sluggish. I also have little control over the songs that are queued. I have an ugly hack which stops the same song being requested twice in a row but I can’t stop one person requesting hundreds of songs. I’m now looking at making a module from scratch which uses a database for the songs. This can limit each user to so many requests per hour and each song has to have a gap of at least an hour between plays.

No Comment.

Add Your Comment