iTunes Podcasting Plugin

Creating and modifying plugins.
Post Reply
dakira
Regular
Posts: 20
Joined: Tue May 25, 2004 4:21 am

iTunes Podcasting Plugin

Post by dakira »

Hi,

I'm writing this post because I don't want to start something, someone else is already working on.

So basically I want a plugin for podcasting, that doesn't only add a media enclosure (like the existing one) but also makes the feed 100% iTunes compatible according to the iTunes Podcasting Specs. As far as I can see, the following would be needed or would be nice to have:
  • the iTunes-podcast feed should be a seperate feed because usually you wouldn't want the standard RSS feed layout, namespaces and the standard blogname and subtitle (as description) in the feed. (I don't know how easy it is to accomplish to define a completely new feed. Any comments?)
  • that means these things have to be in the plugin configuration. At least the title, description and some global entities required by iTunes like "language" and of course the special iTunes entities (i.e. "itunes:category"))
  • as for the feed items: there needs to be a hook to the backend because on entry creation we need to know several things that can not be derived from the regular data (i.e. duration of the podcast). I'm not that far into the plugin API, yet, but I think that also means a new sql table. Does the API handle that? Another possibility would be to enclose such information in special tags inside the regular entry. not very clean, though.
  • to immediately update the iTunes directory it could be pinged though XML POST as described in the above specs, if there are other podcast directories featuring this, they could be pinged as well.
  • additionally the feed might be automatically patched though feedburner to keep track of the stats.
Okay.. now I know that I need this stuff.. but are there any other podcasters who would appreciate such a plugin? Any additional thoughts?

It'd also be nice if the plugin development pros here could tell me how difficult and labor-intensive this endeavor is going to be. I got medium PHP skills. That means that as far as I have looked at the plugin API I understood what was going on.. but of course some pointers in the right directions would speed up the process of getting this done.

Cheers,
dakira

PS: I know this iTunes stuff is all proprietary, but the thing is.. that as a podcaster you want to be as accessible as possible.. and.. if you have everything set up correctly the majority of your listeners will come from iTunes which proves that it is (unfortunately still) important.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: iTunes Podcasting Plugin

Post by garvinhicking »

Hi Dakira!

Great to read you're into developing things for Serendipity! :-)
[*] the iTunes-podcast feed should be a seperate feed because usually you wouldn't want the standard RSS feed layout, namespaces and the standard blogname and subtitle (as description) in the feed. (I don't know how easy it is to accomplish to define a completely new feed. Any comments?)
It's not hard to define a new feed, but the problem is that in current s9y versions feeds are template-specific and cannot be specified by plugins.

If you call the RSS-feed via "rss.php?version=2.0", serendipity looks for a "feed_2.0.tpl" inside your current template directory. So you could specifiy rss.php?version=itunes for example, and if you have a feed_itunes.tpl file that would be used..

I just patched the SVN core for serendipity 1.2 tree so that plugins can now also override a template with their own directory using the 'frontend_rss' hook.

Some code like this:

Code: Select all

case 'frontend_rss':
    if ($eventData['version'] != 'itunes') {
        // We only listen on the 'itunes' version and don't change other feeds
        break;
    }
    
    if ($eventData['template_file'] != 'feed_itunes.tpl') {
        // If the current setting for "template_file" is not a string like "feed_itunes.tpl"
        // this means that the user already has a LOCAL template file called this. In this
        // case, $eventData['template_file'] will be something like "/home/blog/templates/mytemplate/feed_itunes.tpl",
        // and our plugin should not override the local user template file
        break;
    }

    // Plugin directory must be a valid smarty template directory to display a feed .tpl from here!
    $serendipity['smarty']->template_dir[] = dirname(__FILE__);
    
    // Set the RSS-feeds template file to a template in the current plugin directory
    $eventData['template_file'] = dirname(__FILE__) . '/feed_itunes.tpl';
    break;
This will make a plugin be able to listen on an 'itunes' event hook and modify files.

Within the 'feed_itunes.tpl' file you can then specifiy which plugin hooks to use, which namespaces to use, etc.
[*] that means these things have to be in the plugin configuration. At least the title, description and some global entities required by iTunes like "language" and of course the special iTunes entities (i.e. "itunes:category"))
Yes, within the frontend_rss event hook, a plugin can already assign any smarty variable it likes, by using configuration variables frmo the plugin without a problem.
[*] as for the feed items: there needs to be a hook to the backend because on entry creation we need to know several things that can not be derived from the regular data (i.e. duration of the podcast). I'm not that far into the plugin API, yet, but I think that also means a new sql table. Does the API handle that? Another possibility would be to enclose such information in special tags inside the regular entry. not very clean, though.
Yes, the API allows to attach any kind of free-form information to an entry on creation.

The "Extended Properties for entries" plugin usually deals with this, people can there define any names used for additional variables. The podcast plugin for example already suggests this (see http://board.s9y.org/viewtopic.php?p=48642#48642).

Of course your plugin can also attach those freeform things to it. It can store the properties into the 'Serendipity_entryproperties' table, every data can be saved there and will easily be available for retrieval, as those variables are loadde by the s9y core methods.

Some example plugins that use the entryproperties table for storing data independently of the 'extended entryproperties' plugin are:

serendipity_event_custom_permalinks,
serendipity_event_includeentry,
serendipity_event_metadesc

Those three save their data using the 'backend_publish' / 'backend_save' API hooks and display their input fields using the 'backend_display' event hook.
[*] to immediately update the iTunes directory it could be pinged though XML POST as described in the above specs, if there are other podcast directories featuring this, they could be pinged as well.
The functionality of the xmlrpc-ping plugin (serendipity_event_weblogping) could be duplicated into your plugin for that functionality, yes. Or of course you could refer to the weblogping plugin if people want to announce it using that plugin.
[*] additionally the feed might be automatically patched though feedburner to keep track of the stats.
Right, feedburner redirection could be added to your local plugin just like redirection happens in rss.php already, but for a specific itunes feed, if you like.

I personally would appreciate it very much if this itunes functionality could be added to the existing podcast plugin to upgrade it. I think this would be most welcome so that users don't need to choose between two plugins, and the extra functionality of it would suit the podcast plugin quite well.
It'd also be nice if the plugin development pros here could tell me how difficult and labor-intensive this endeavor is going to be. I got medium PHP skills. That means that as far as I have looked at the plugin API I understood what was going on.. but of course some pointers in the right directions would speed up the process of getting this done.
I hope I could help you with some input. I generally think it should not be too hard, I think you will be able to achieve your goals. :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: iTunes Podcasting Plugin

Post by garvinhicking »

# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tpost
Regular
Posts: 77
Joined: Fri Sep 21, 2007 1:45 am

Re: iTunes Podcasting Plugin

Post by tpost »

dakira wrote:Okay.. now I know that I need this stuff.. but are there any other podcasters who would appreciate such a plugin? Any additional thoughts?
I know I would appreciate this!

Right now I am unable to import my feedburner podcast feed because it is unable to detect the enclosure tag properly.

Just wondering if you have made any headway in the development of this plugin?

Thanks!
KDB9000
Posts: 1
Joined: Wed Oct 24, 2007 6:34 pm

Post by KDB9000 »

I am interested in the iTunes plugin too. I installed the one that they have already but it doesn't have the RSS feeds that I want. I would like it for each category. Anyone know how to edit the default template for category's?
Post Reply