I've developed a logging sub-module for station. The log module does just that, log's played tracks from a SHOUTcast stream to the database and provides a recently played block and page. There's still work to be done but I think I think it's in a state where it can be tested.

Station log currently uses a modified version of the shoutcast module to retrieve metadata for tracks played since the last track logged to the database. Album and artist is written/linked to station_catalog nodes. Track title for an artist/album combination is written once to station_log_track and re-used. I've added basic amazon affiliate buy links if a default amazon.module affiliate link is set.

Although I've been running it on http://indiesf.com for a few weeks now, I DO NOT RECOMMEND INSTALLING IN A PRODUCTION ENVIRONMENT YET!

@ To Do

1) Update recently played block list via Ajax.
2) Get shoutcast current track to show in block if it hasn't been logged yet.
3) Handle multiple schedules. Need to link station schedules to SHOUTcast admin urls.
4) Integrate with amazon.module to retrive album cover image URLs.
5) Add weekly charts, new and popular this week blocks (separate module?)
6) Create "album/song not found" in MusicBrainz report.
7) Adjust time for the user's timezone (see station_nowplaying)
8) What to do on multi-artist albums (compilations)?
9) Add LinkShare search affiliate links for iTunes.
10) Validate song names against MusicBrainz.
11) Look into getting and setting genre for station_catalog items, does MusicBrainz provide genre?
12) Add views support.

@ Installation

Install and configure a SHOUTcast stream in this modified version of the shoutcast.module
https://github.com/ckieffer/drupal-shoutcast

Install and configure station_log.module
https://github.com/ckieffer/drupal-station/tree/master/log/

Create a cron job to hit http://mysite.com/station/log/update with wget or curl every few minutes.

Comments

thumb’s picture

Forgot one other important installation step. Update station_catalog to HEAD and apply this patch!

http://drupal.org/node/918920#comment-3675938

drewish’s picture

I'm running out the door so I can't look at them right now but I'm interested, as long as we can make sure the input method is pluggable (so we could swap it out for a form that, say selects from the catalog) and that this is a general purpose module.

thumb’s picture

I'm more than willing to make this pluggable to support form input and support for other stream data sources. I've also thought about integration with program playlists.

frederickjh’s picture

I would agree with drewish in making it pluggable. I would like to develop something that would be able to interface with radio station automation systems to take a data stream from them and log it. So, if you make the shoutcast input portion of this logging module in to a separate station_log_shoutcast__input module that would make it possible to create other input modules.

I would take this a pluggable modules further and say can we make the affiliate programs, like Amazon.com in your case, pluggable too? Maybe called station_log_amazon_affiliate module? That way folks that want to use an different affiliate program or maybe more than one could built other affiliate module for it as well.

drewish’s picture

I posted a couple of comments to the project on github. I'm not sure what the best way to go through those is.

thumb’s picture

Thanks, I received notification on all of them. All of them make sense and are much appreciated. I'll start addressing them as soon as possible.

drewish’s picture

found this old issue. i'd love to try to align them: #131186: Revisions/Modifications to Playlist Entry

thumb’s picture

frederickjh, sorry for the delayed reply.

What about a configuration option to choose from a list of supported stream metadata retrieval plugins? Each plugin would be encapsulated within station_log include file. I'm still new to Drupal module development and am not completely against what you're proposing, but I need to see the pros and cons of each approach discussed before proceeding.

As for affiliate links, I can see the need for a separate station_affiliate_link.module that provides link building utility for station_log and station_catalog. Again, each affiliate program's methods would be encapsulated within an include file.

thumb’s picture

I've thought a bit more about pluggable stream support. I see how a separate module may make more sense. My current thought is to add a station sub-module, station_stream. This module will provide the means to store streaming server type and connection parameters. Server-type-specific methods would be added/managed in include files.

Does this seem like a reasonable approach?

frederickjh’s picture

Sorry about the delayed response. I though I would be notified of replies to the issue. I need to figure out how I can be.

Yes, that sounds good to me to add a sub-module as then the hooks will be there for other sub-modules as well.

frederickjh’s picture

I just had one more though regarding the new submodule's name.

Maybe shoutcast should be in the name as different streaming servers do meta-data differently. Icecast does not have a PLAYED.html, or anything like it yet, but there is talk of developing something.

So with a name of station_stream either your module would need to be flexible enough to accommodate configuring it for other types of meta-data input from streaming servers or I would suggest making it do one thing well (get the meta-data from Shoutcast) and give it a name to reflect that so there is not confusion or a need to rename it later when other types of stream meta-data modules are created.

Hey, maybe that is a good idea too. Why not included meta-data in the module name as well? Something like station_shoutcast_meta-data.

drewish’s picture

I've been doing a lot with ctools since I've been working at Sony and I think it might make sense to use its plugin architecture rather than full modules. I need to give the updated code a look but if we can figure out what the metadata interface should look like, I'd be more than happy to help get the plugin part working.

drewish’s picture

Super excited p.s: I was just thinking how crazy it was to be having a discussion with two other people about programming on the station module. If you'd told me when I started it that there'd be this many people interested in helping I don't think I'd have believed you. It got even weirder when I realized that the module just passed its 5 year anniversary. I like to offer a huge thank to all the past, present and future contributors.

thumb’s picture

Great. I'll start looking at ctools. I had just installed the D7 version since the dev views package of requires it. What I'm not clear on are requirements for other streaming server and what a plugin approach entails specifically. Drewish, can you outline the high-level API points?

thumb’s picture

I'm pretty excited to work with you and Tim! BTW, thanks for choosing Drupal for the KPSU five years ago!