Podcast Tracking System

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

Post Reply
User avatar
Serpent_Guard
Forum Newbie
Posts: 6
Joined: Mon Nov 24, 2008 2:07 pm

Podcast Tracking System

Post by Serpent_Guard »

I've been a technical director of a podcast for quite some time. I wanted to track podcast usage, and at the time I wasn't aware of services like podtrac.com. Even if I was, I'm wary of letting other domains be involved in how users end up listening to the podcast. So I've been working on a podcast tracking system. I'm not particularly looking for critique here, but it would be welcome - I'm just looking for ways to give others access to this system, if they're less technically inclined than most.

Anyways, you can download the package here. My feed is at http://dongbufeng.net/twilight/podcast/ ... leFeed.xml, so this system should be unzipped to the /podcast directory.

Usage: Any file in the /podcast directory can be tracked by replacing '/podcast/' with '/podcast/tracker/'. For example, you're hosting a ZIP file, and want it's downloads tracked. Instead of giving out the URL http://dongbufeng.net/twilight/podcast/files/foo.zip, give out http://dongbufeng.net/twilight/podcast/ ... es/foo.zip. It'll also pass through any URL arguments, and the arguments will be present in the log. The /counter/index.php file parses and aggregates the log file, giving an overall hit count, as well as per-file, per-IP, and per-country hit counts.

I also implemented a feed builder, making it much easier to add, edit, and delete episodes without ever having to work with the XML feed file. This tool, along with a collection of other useful links, is available at /admin/index.html.
Last edited by Serpent_Guard on Sun Nov 30, 2008 11:22 am, edited 1 time in total.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Podcast Tracking System

Post by josh »

You use file based storage which isn't my cup of tea, but allows the application to be more portable. Kudos for sacrificing your sanity for the greater good of the user base. The code seems well implemented + designed for its purposes. I didn't actually fire it up but just skimmed through. I would use define() to define constants for some of the configuration settings, but that's just me. If you plan on making it more complicated you might want to look into a tiered approach where you template the presentation separate from the business logic. You could also provide adapters for using a relational database as well as file based storage, in case performance is a concern.
Post Reply