Using XMLRPC to remotely retrieve programming information

Events happening in the community are now at Drupal community events on www.drupal.org.
bwgames's picture

We're using the Station module for our website, but I'm trying to integrate the schedule in some pre-existing infrastructure we have.

Ideally, what I need is something (using XML-RPC?) that will return the currently scheduled program information (i.e. title of the show), that I can query using PHP....

I looked into the MySQL database at the station_schedule table, and it needs to be cross-referenced with the 'node' table (where type=program), but I wasn't sure how the start and finish timestamps worked....

But I figured there must be a way to return the current program via XML-RPC, but I'm not sure how...?

Thanks!

Comments

bramface's picture

Hey, BWGames.

This may be similar to something we are now getting into with Drewish. We use NextGen (a program developed by ClearChannel, I believe >shudder<) that churns out a selectively randomized playlist, which the WKZE DJs then modify. As they do, they key in the "Song Now Playing".

Below is our current job description. Andrew is adding some timestamp fields to the TRACKS table to help this go on.

We'll start coding after we've installed PHP 5.0 on our system, which will make extra functionality [ActiveCollab] and cleaner code [Simple XML] possible.  We hope to have that completed by the end of the upcoming week.
1) Install PHP 5.0 (Drupal will still run on PHP 4, but we will reference PHP 5.0 pages.)
2) Explore the capacities of NextGen's AutoFTP output.
3) Once these two steps are done, we'll create a "Now Playing" Module, as follows:
   a) Create a block (which can be positioned anywhere on the site)
   b) The Block will contain an iframe that loads a PHP 5.0 page, refreshing every 30 seconds via Javascript.
   c) The PHP 5 page will use "simple XML" to create an object (Track>Artist, Track>Title) and format it for "Now Playing" .
4) Once the "Now Playing" Module is working, we will create the "Auto Playlist" Module, as follows:
   a) We will write a PHP 5.0 page that calculates an MD5 Hash of http://wkze.com/static/wkze/songlist.txt and saves that value.   
b) If the Hash is different than the previous value, it will save the current song data to the (checksum) and saves it to the Station Playlist Track table. 

Would you like to co-develop with us?

Bram Moreinis, webmaster
WKZE - http://wkze.com

Interested in co-development

thumb's picture

I'm curious to know the current status of your module development. I'm new to developing Drupal modules, but I'm not new to PHP :) I had already started to write my own code for "Now Playing" display but would prefer to assist you in your efforts and add the following features.

1) Display "Buy now" buttons next to listed tracks
2) Create a "Browse daily play list archive" page (similar to http://woxy.lala.com/music/playlist/)
3) Create a "Weekly chart" page (similar to http://woxy.lala.com/music/charts.php)
4) Display a "New this week" block

bwgames, it's already in

drewish's picture

bwgames, it's already in there. Have you looked at station_schedule_xmlrpc()? There's a method called station_schedule_program_get_at() that does exactly what you want. See station_get_program_at() to see how to call it from Drupal.

Yeah..

bwgames's picture

Thanks, I suspected there was something already in there...

I don't actually want to call it from within Drupal though, I want to call it from an external PHP script.
However, the PHP xmlrpc is listed as experimental...

Now to figure out how to call it remotely....

it's just a matter of

drewish's picture

it's just a matter of picking a library. there's always PEAR's XML-RPC

Radio

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: