Click to See Complete Forum and Search --> : Create a Podcast or RSS feed with Linux


psych-major
01-03-2007, 04:26 PM
First, this assumes that you have 1. something to podcast, 2. a place to store it and 3. a way to get it there.
I use audacity, www.neureal.com and gftp for these respective tasks.

Podcasts:
A podcast is essentially an xml file that defines an RSS feed that encapsulates one or more multimedia files, and several blog sites purport to offer this functionality, but I could get none of them to work.
I eventually found a Windows shareware app called FeedForAll (http://www.feedforall.com/feedforall.htm) that was simple and worked like a dream! (It's free to try for 30 days, and $40 to purchase)
However, I want to do this with Linux, 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 (http://blogs.law.harvard.edu/tech/RSS).
(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 the Castle Rock Church of the Nazarene</description>
<language>en-us</language>
<docs>http://blogs.law.harvard.edu/tech/RSS</docs>
<generator>gedit in Ubuntu Linux</generator>

<item>
<title>12-31-06 AM Sermon</title>
<description>Am Sermon - Pastor Craig Baird</description>
<link>http://crnaz.net/recordings/12-31-06_AM.mp3</link>
<enclosure url="http://crnaz.net/recordings/12-31-06_AM.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 - Pastor Craig Baird</description>
<link>http://crnaz.net/recordings/12-24-06_AM.mp3</link>
<enclosure url="http://crnaz.net/recordings/12-24-06_AM.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:<?xml version="1.0" encoding="UTF-8"?>This is a required entry


Next we open RSS and define its type:<RSS version="2.0">This is also required


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>gedit in Ubuntu Linux</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 - Pastor Craig Baird</description>
<link>http://crnaz.net/recordings/12-31-06_AM.mp3</link>
<enclosure url="http://crnaz.net/recordings/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>
Once you have completed your xml file, save it as some_file_name.xml, and upload it to your webspace. Mine is at http://crnaz.net/podcast.xml. This exact URL is what your users need in order to subscribe to your podcast with Amarok, Rhythmbox, iTunes, etc.

Every time your content changes, for example I keep a rolling 6 weeks worth of Mp3 files on mine, you need to edit your xml file accordingly and upload it again.

Your subscribed users will now get each new podcast per whatever options they have set in their multimedia app.

RSS Feeds:
Another benefit to being able to create your own RSS feed is the ability to aggregate RSS feeds from another site. For example, I'm looking for a Yeti mountain bike on CraigsList. CL offers RSS feeds of any search you execute, but only has search capability within individual locales. I want to search all of Colorado and New Mexico, so I set up my own RSS feed that aggregates all of the local CL RSS feeds for those sites. Here's what that file looks like:<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">

<channel>
<title>Yeti Searches</title>
<link>http://home.earthlink.net/~corey.maddocks/</link>
<description>Corey's search for Yeti mountain bikes</description>
<language>en-us</language>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>gedit in Ubuntu Linux</generator>

<item>
<title>Yeti in Denver</title>
<description>Searches for Yeti on Craigslist-Denver</description>
<link>http://denver.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Boulder</title>
<description>Searches for Yeti on Craigslist-Boulder</description>
<link>http://boulder.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Colorado Springs</title>
<description>Searches for Yeti on Craigslist-Colorado Springs</description>
<link>http://cosprings.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Fort Collins</title>
<description>Searches for Yeti on Craigslist-Fort Collins</description>
<link>http://fortcollins.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Pueblo</title>
<description>Searches for Yeti on Craigslist-Pueblo</description>
<link>http://pueblo.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Rocky Mountain</title>
<description>Searches for Yeti on Craigslist-Rocky Mountain</description>
<link>http://rockies.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Western Slope</title>
<description>Searches for Yeti on Craigslist-Western Slope</description>
<link>http://westslope.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Albuquerque</title>
<description>Searches for Yeti on Craigslist-Albuquerque</description>
<link>http://albuquerque.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Las Cruces</title>
<description>Searches for Yeti on Craigslist-Las Cruces</description>
<link>http://lascruces.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Roswell</title>
<description>Searches for Yeti on Craigslist-Roswell</description>
<link>http://roswell.craigslist.org/search/bik?query=yeti</link>
</item>

<item>
<title>Yeti in Santa Fe</title>
<description>Searches for Yeti on Craigslist-Santa Fe</description>
<link>http://santafe.craigslist.org/search/bik?query=yeti</link>
</item>

</channel>

</rss>The framework is essentially the same as my podcast, but notice there is no encapsualtion of files, as all I'm interested in here is links to other RSS feeds. This could also be used as a feed for web pages, text files, or whatever...

So now that you have the ability to create RSS feeds and podcasts, have fun and use it wisely!

bwkaz
01-03-2007, 09:13 PM
<?xml version="1.0" encoding="windows-1252"?> Except that windows-1252 isn't a recognized XML encoding, that I know of. You want iso8859-1 instead. (Yes, I'm being pedantic, but I HATE IT when web pages or XML files or whatever get served up in MS-specific character sets...)

<enclosure> url="http://crnaz.net/recordings/12-31-06_AM.mp3" length="" type="audio/mpeg" </enclosure> Are you sure this shouldn't be like this instead?:

<enclosure url="http://crnaz.net/recordings/12-31-06_AM.mp3" length="" type="audio/mpeg"></enclosure> Because both are valid XML, but your version isn't quite standard. Usually when you have <string>="<value>" sequences, they're attributes, not the content of a tag.

My version is also equivalent to the self-closing version:

<enclosure url="http://crnaz.net/recordings/12-31-06_AM.mp3" length="" type="audio/mpeg" /> as you said, but mine is equivalent according to the XML standard. Yours is not; if yours is equivalent, it's only because of something RSS-specific. :)

psych-major
01-04-2007, 01:03 AM
Except that windows-1252 isn't a recognized XML encoding, that I know of. You want iso8859-1 instead. (Yes, I'm being pedantic, but I HATE IT when web pages or XML files or whatever get served up in MS-specific character sets...) I missed that in the docs, but it's a valid point. That line in my file came from the original Windows app that I used, so it makes sense that it would be Windows-centric... :eek:

Are you sure this shouldn't be like this instead?

My version is also equivalent to the self-closing version:

<enclosure url="http://crnaz.net/recordings/12-31-06_AM.mp3" length="" type="audio/mpeg" /> as you said, but mine is equivalent according to the XML standard. Yours is not; if yours is equivalent, it's only because of something RSS-specific. :)You'll notice I have it listed both ways, and they both work, but my real file has it your way. (I think)

psych-major
01-04-2007, 02:24 PM
*Note* I have edited the original instructions as follows:

Changed the xml encoding type as suggested by bwkaz
Re-phrased the encapsulation syntax to adhere more closely with the RSS standard. I'm doing it correctly in my live file, but my original description was a little misleading...



Had to change the encoding method back to the original in order to be compatible with iTunes.
Ignore the conversation between bwkaz and me, the instructions in the first post are correct! :cool:

bwkaz
01-04-2007, 08:34 PM
You'll notice I have it listed both ways, and they both work, but my real file has it your way. (I think) Your non-self-closing version (where you had separate opening and closing tags) had this:

<enclosure> url="..." xxx="..." </enclosure>

not this:

<enclosure url="..." xxx="..."></enclosure>

In other words, you had the attributes in the tag as content, not as attributes, because you had a > character too early. But I see you've changed it, so never mind. :)

psych-major
01-05-2007, 01:46 AM
Yeah, when I went back and looked, it turned out to be a typo. That'll teach me to get creative with examples!

psych-major
01-07-2007, 07:31 PM
Except that windows-1252 isn't a recognized XML encoding, that I know of. You want iso8859-1 instead. (Yes, I'm being pedantic, but I HATE IT when web pages or XML files or whatever get served up in MS-specific character sets...) It turns out that when I switch to iso8859-1 encoding, Rhythmbox, Amarok and web browsers still work, but iTunes does not. I had to change it back...

bwkaz
01-08-2007, 09:01 PM
Grrr, crappy closed-source software... :mad:

(Yes, I know, it's not Microsoft. But that doesn't mean it works right, or that you, or I, or anyone except Apple, can fix it when it doesn't. :p)

psych-major
01-08-2007, 09:27 PM
agreed... :mad: