KOZT FM The Coast
KOZT (The Coast FM) is the top radio station in Mendocino County, CA. In addition to their musical activities, The Coast serves as an information hub for area events and concerts in Northern California. They really shine when the power goes out — their contacts with the power company and law enforcement enable them to provide timely updates during bad weather emergencies. One of their primary requirements was to be able to quickly add and remove events highlighted on the home page. To provide background info for the on-air staff, they maintain an extensive database (over 13,000 entries) of music, entertainment, and historical events. They invite people to share their stories about life in Mendocino County, and provide an audio library of stories. They also sell promotional items in their store, mostly logo merchandise along with some locally-produced music CDs.
The Coast also streams their broadcast on the Web, and you can play the current stream while visiting the site. The site is fully responsive, and you can play the audio feed on both desktop and mobile devices. One of the fun things was to show what’s currently playing, along with the recent history. They wanted to make sure this information was continually updated at sub-minute granularity, so it’s a mix of backend PHP (with a cron job) and Javascript on the frontend to handle the display updates, communicating through the WP-Ajax interface. The scheduling software used by the station spits out an XML file whenever the stream changes. Since that software cannot notify WordPress when changed, it’s necessary for backend code in WordPress to watch the file for changes. Once the file has changed, the backend processes the results and saves it as an HTML snippet. Each visiting browser periodically sends its last-updated timestamp to the server, which sends back the updated song info if there’s been an update since that client last checked.
KOZT.com has quite a bit of custom code: it’s a custom theme, and a number of additional modules were built in PHP along with Javascript on the front-end.