I posted a podcast a while back on a speech I had given at a recent event on Entrepreneurship, called the Rocket Pitch event. I’m about to post another podcast and an iPresent presentation on a recent conference I attended. It got me thinking about the previous podcast and I wanted to double check that my RSS feed included a proper link to the mp3 file using the RSS enclosure tag. When I checked the feed this is all I saw.
Notice that there is no enclosure tag for this entry. A quick check of the Wordpress docs on Podcasting says that by simply creating an absolute URI to an MP3 file like this: <a href=”http://example.com/my-podcast.mp3″>My podcast</a> will automatically generate the correct RSS feed for you. But this isn’t working for my setup which is WP1.5.2. I did some digging around in the Wordpress forums and saw that others had experienced the same problem. There seemed to be several different workarounds such as using custom fields or verifying directory permissions or editing certain php files - there just didn’t seem to be a definitive solution.
I decided to take a quick spin throught the source. I did a recursive seach for “enclosure”, and found the function rss_enclosure() in the file feed-functions.php. A “custom_field” array seemed to be populated with values that are parsed into 3 pieces. These items are used to generate a proper enclosure tag with the attributes “url”, “length”, and “type”. So, I figured I’d give it a shot and add a custom field to the post. A custom field can be created at the bottom of a post in the “Advanced” section. I added a custom fiield with a new key named “enclosure”. Then I added 3 values for this new key (per the RSS spec), each on a separate line like this:
http://www.ipresent.net/media/RocketPitch.mp3
3568245
audio/mpeg
I republished and viewed my feed URL - and sure enough, an enclosure tag.
This probably isn’t the best solution, as I must now create a custom field for each podcast I do, but it’s a reasonable workaround.
If you are using Wordpress and are podcasting, hopefully this tidbit will help.