Now I Have a Blog TooNow I Have a Blog Too Christopher Finke is a software engineer at Mahalo. He is available for birthday parties and bar mitzvahs.

Easy-peasy podcasting

Want an easy way to generate a podcast or RSS feed? At Eliot's request, I wrote a PHP script that generates an RSS feed based on the contents of its parent directory, so whenever you add files to that directory (or its subdirectories), the feed is updated with links to those files. It also supports enclosures, so if you add an audio or video file to the directory, that file will be available to podcast clients. If you modify a file in the directory, the feed updates the link so that subscribers will see that it has changed. It's a no-fuss way to syndicate content without having to tie it into a CMS like Wordpress or TypePad.

Here's how to use it:

  1. Save this file as EasyFeed.php (or dir.php or feed.php, it doesn't really matter).
  2. Copy it to a directory on your webserver.
  3. Subscribe to the feed with any RSS or podcasting client.

That's all there is to it. For example, here's the feed of all of the files I've ever uploaded for use in my blog. If you subscribe to that feed with iTunes, you'll see that I've uploaded two audio files: programming.mp3 and calacanis.mp3. iTunes will automatically download them, as well as any other audio/video files I upload. No fuss, no muss.

6 Responses to “Easy-peasy podcasting”

  1. RobotSkirts » Blog Archive » Easy-peasy podcasting Says:

    [...] Easy-peasy podcasting Kick ass! Thanks again Chris. [...]

  2. Softsled Says:

    Thanks for the script. I just love running across little gems like this.

  3. Softsled Says:

    Nice script. I will find a good use for it. One question though.
    (I am wanting to drop some php redirect files in the directory so I can create a custom feed for the content that I choose.)
    Let's say I wanted the title to read "Chris Finke Rocks", but my file is actually "Chris_Finke_Rocks.php". How hard would it be to remove the "_" and replace it with a space, and also remove the .php extension? So basically, I want to create a title based on the filename but retain the correct url to the file.

  4. Christopher Finke Says:

    Softsled: you could replace this line:

    echo htmlentities($file);

    with

    echo htmlentities(str_replace("_"," ",strrev(array_pop(explode(".", strrev($file), 2)))));

    (Haven't tested that, but it should work. There are other ways as well, but this once came to mind first.)

  5. Bryan Mendoza Says:

    This is the first script I've been able to get working on our poor beatup server. Any chance you could tell me how to read ID3 tags or some way to add a description/title for each file? I'd like to make it simple enough that our intern can update this stuff via web form...

  6. komputery bydgoszcz Says:

    We are programing group form poland.

Leave a Reply