Creating your own podcast with RSS and XML
Posted in Computer stuff on August 3rd, 2008 by coreyThis assumes that you have:
- something to podcast
- a place to store it a way to get it there
- For these respective tasks I use
- Audacity
- iPowerWeb or StartLogic
- WinSCP or gftp
What is a Podcast?
A podcast is essentially an xml file that defines an RSS feed that encapsulates one or more multimedia files. The resulting ‘feed’ can be subscribed to with any number of client software applications, depending on the type of media involved. Several blog sites purport to offer this functionality, but I could get none of them to work the way I wanted.
I eventually found a Windows shareware application called FeedForAll that was simple and worked like a dream. (It’s free to try for 30 days, and $40 to purchase)
However, I wanted to do this with Linux, and I also didn’t want to spend $40, so I opened the xml file that is the output from FeedForAll, and discovered that it is really quite simple to edit it by hand.
Below is the text of a working xml file, followed by brief explanations of the various sections. You can also access the official RSS docs here.
(feel free to copy my file and change what you need for your purposes)
<?xml version=”1.0″ encoding=”UTF-8″?>
<RSS version=”2.0″><channel>
<title>CRCN Sermon Recordings</title>
<link>http://www.crnaz.net/</link>
<description>Sermon Recordings of CRCN</description>
<language>en-us</language>
<docs>http://blogs.law.harvard.edu/tech/RSS</docs>
<generator>EditPad Lite</generator><item>
<title>12-31-06 AM Sermon</title>
<description>Am Sermon</description>
<link>http://crnaz.net/recordings/12-31-06_AM.mp3</link>
<enclosure url=”http://crnaz.net/12-31.mp3″ length=”" type=”audio/mpeg” />
<pubDate>Sun, 31 Dec 2006 13:00:00 -0700</pubDate>
</item><item>
<title>12-24-06 AM Sermon</title>
<description>Am Sermon</description>
<link>http://crnaz.net/recordings/12-24-06_AM.mp3</link>
<enclosure url=”http://crnaz.net/12-24.mp3″ length=”" type=”audio/mpeg” />
<pubDate>Sun, 24 Dec 2006 13:00:00 -0700</pubDate>
</item>
</channel>
</RSS>
First, we open and define the type of our xml file:
This is a required entry
<?xml version=”1.0″ encoding=”UTF-8″?>
Next we open RSS and define its type:
This is also required
<RSS version=”2.0″>
Every RSS feed requires at least one channel:
<channel>
<title>CRCN Sermon Recordings</title>
<link>http://www.crnaz.net/</link>
<description>Sermon Recordings of the Castle Rock Church of the Nazarene</description>
<language>en-us</language>
<docs>http://blogs.law.harvard.edu/tech/RSS</docs>
<generator>EditPad Lite</generator>
Not all of these definitions are required, see the docs for details.
After defining our channel, we can define items for it. For a podcast, these are the actual media files that we want to encapsulate and distribute:
<item>
<title>12-31-06 AM Sermon</title>
<description>Am Sermon</description>
<link>http://crnaz.net/12-31-06_AM.mp3</link>
<enclosure url=”http://crnaz.net/12-31-06_AM.mp3″ length=”" type=”audio/mpeg” />
<pubDate>Sun, 31 Dec 2006 13:00:00 -0700</pubDate>
</item>
Again, not all fields are required, see the docs.
Also, the enclosure field must have the complete URL for your actual media file, and the length= and type= fields are required, but you can leave them blank and let the application determine that info based on the file itself.
The link field is not required for podcasts, but it is nice if your user wants to subscribe to your podcast feed in their browser or email client.
*Note* You can open/close the encapsulation several ways. They work exactly the same way, but the way I’ve displayed it is according to the published standard.
Once you have defined all the items you want, you need to close the channel:
</channel>
and the RSS feed:
</RSS>
The completed xml file can be saved as some_file_name.xml, and uploaded to your webspace.
The exact URL is what users need in order to subscribe to the podcast with iTunes, Amarok, Rhythmbox, etc.
Every time your content changes, for example I keep a rolling 6 weeks worth of Mp3 files on mine, you need to edit the items in your xml file accordingly and upload it again.