RSS XML Tutorial: Podcasts

About this Tutorial

This tutorial shows you how to manually create a podcast feed for your MP3 files - this can be handy if you have access to only Web 1.0 technology. If your blog or wiki already does this for you...don't bother with this.

A podcast feed is basically an RSS feed with a few extra tags which are used by iTunes and other podcatchers to recognize audio file links. For this part of the tutorial, I will assume that :

  1. You have created and posted an MP3 file into Web space. Penn State users can visit http://podcasts.psu.edu/help for technical assistance in that area.
  2. You understand the concept of an RSS XML file. See the RSS XML Tutorial if you need to see that reference.

Create RSS for Podcast

  1. Create an RSS file following the instructions in the RSS XML Tutorial.
  2. Change the <rss version ="2.0"> tag to <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  3. Create an <item> for each podcast audio file. See Example below

<?xml version="1.0" encoding="utf-8"?>

<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">


<channel>

<title>Penn State Song Channel</title>

<link>http://nowhere.psu.edu/songs</link>

<description>Penn State Songs </description>

<language>en-us</language>

<copyright>©2006 Penn State</copyright>

<managingEditor>xyz123@psu.edu</managingEditor>



<item>

<title>The Paternoville song</title>

<category>Penn State songs</category> 

<pubDate>Sun, 01 Jan 2006 11:00:00 EST</pubDate>
</item>

</channel>

</rss>

The Enclosure Tag (link to MP3 File)

The main difference between a regular RSS file and a podcast RSS file is the <enclosure /> tag within the <item> tag which specifies the link to the .mp3 file. The syntax is:

<enclosure url="http://www.psu.edu/podcast.mp3" length="60" type="audio/mpeg" />

Note that

  • The <enclosure /> must end with a slash in order for the tag to conform to XML.
  • The url= attribute is where the link to the mp3 file is inserted.
  • The type=audio/mpeg/ attribute specifies that the file is an MP3 file
  • The length= attribute is optional, but should be specified in seconds.

<?xml version="1.0" encoding="utf-8"?>

<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">


<channel>

<title>Penn State Song Channel</title>

<link>http://nowhere.psu.edu/songs</link>

<description>Penn State Songs </description>

<language>en-us</language>

<copyright>©2006 Penn State</copyright>

<managingEditor>xyz123@psu.edu</managingEditor>



<item>

<title>The Paternoville song</title>

<link>http://nowhere.psu.edu/paternoville.mp3</link>

<enclosure url="http://nowhere.psu.edu/paternoville.mp3" type="audio/mpeg"/>

<link>http://nowhere.psu.edu/paternoville.mp3</link>
<category>Penn State songs</category> 

<pubDate>Sun, 01 Jan 2006 11:00:00 EST</pubDate>
</item>
</channel>

</rss>

Note on <link> tag

The <link> tag can also be included and can go to either the same .mp3 file or to a news story with a link to the file.

The <link> file can be parsed by many news readers and will allow users to play the podcast in an audio player such as Windows Media Player, Quicktime or Real Player.

Add iTunes Meta Tags

The following tags specific to iTunes can be added to your file as additional <item> tags.

  • <itunes:subtitle>...</itunes:subtitle>
    Text Appears in the “Description” field within iTunes. Limited to 255 characters.
  • <itunes:explicit>...</itunes:explicit>
    Your choices are “Yes” or “No”. No is default unless your audio file contains “profanity”.
  • <itunes:category>...</itunes:category>
    Categories follow that of news and entertainment. See http://www.feedforall.com/itune-tutorial-tags.htm for a list of tags.
  • <itunes:keywords>...</itunes:keywords>
    Search keywords. Spearated by a space. Limited to 255 characters.
  • <itunes:summary>....</itunes:summary>
    Text Appears in the “Get Info” window along with other information.
  • <itunes:author>...</itunes:author>
    The creator of the audio file.

Complete Podcast RSS Code

<?xml version="1.0" encoding="utf-8"?>

<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">


<channel>

<title>Penn State Live</title>

<link>http://nowhere.psu.edu/songs</link>

<description>Penn State Songs </description>

<language>en-us</language>

<copyright>©2006 Penn State</copyright>

<managingEditor>xyz123@psu.edu</managingEditor>



<item>

<title>The Paternoville song</title>

<link>http://nowhere.psu.edu/paternoville.mp3</link>

<enclosure url="http://nowhere.psu.edu/paternoville.mp3" type="audio/mpeg"/>

<category>Penn State songs</category> 

<pubDate>Sun, 01 Jan 2006 11:00:00 EST</pubDate>

<itunes:explicit>No</itunes:explicit>

<itunes:subtitle>Sung to the tune of Margaritaville</itunes:subtitle>

<itunes:keywords>Penn State Paternoville </itunes:keywords>

<itunes:category>Music</itunes:category>

</item>
</channel>

</rss>

Testing your Podcast in iTunes

To test your podcast.

  1. Post the XML file into your Web site just like any other HTML or RSS file.
  2. Open the Internet Explorer 7 or Safari, then copy the URL.
  3. Open the iTunes application.
  4. In the Advanced menu, choose Subscribe to Podcast.
  5. Paste the URL into the pop-up window.
  6. Click the Podcasts icon in the left menu to see your subscriptions. Files will either be downloaded or be listed with a Get link.

You can also test your news reader by subscribing to the RSS feed. Links may trigger the playing of an MP3 file.