In my "Sybase ASE Tech Talk Podcast - FIXED!" blog post, I go over why the vendor's podcast feed is broken but I won't bore any one here about that as it is more political than not.

Scenerio: A vendor provides an ancient RSS 1.0 feed that they say works. Problem is that it doesn't work with any podcast aggregator that I know of (iTunes, Amarok, WM 11, etc). I know that RSS 2.0 podcasts work fine, so I download the RSS 1.0 feed, parse it, convert to a RSS 2.0 feed and upload it to my personal website.

In all truth, I gave more than adequate time for the vendor to fix their podcast feed but was rebuffed.

#!/usr/bin/perl use strict; use warnings; use Net::FTP; use XML::RSS; use LWP::Simple; use CGI::Util qw(unescape escape); sub clean_str { # there is a bunch of garbage in the descriptions in the s +ybase rss file my $str = shift; $str =~ s/\%C2\%96 //g; $str = unescape($str); return $str; } my $rss = XML::RSS->new; my $new_rss = XML::RSS->new (version => '2.0', encoding => 'ISO-88 +59-1'); my $content = get( "http://www.sybase.com/detailList/rss.do?nodeId +=113048" ); eval { $rss->parse($content) }; if ($@) { die "Bad XML document!!\n"; } else { $new_rss->channel( title => unescape( $rss->channel('title' +) ), link => $rss->channel('link'), description => unescape( $rss->channel('descri +ption') ), language => $rss->channel('language') ); foreach my $item ( @{$rss->{'items'}} ) { $new_rss->add_item( title => clean_str( $item->{'tit +le'} ), enclosure => { url => $item->{'link' +}, type => "audio/mpeg" }, description => clean_str( $item->{'des +cription'} ), pubDate => $item->{'pubDate'} ); } $new_rss->save("/home/jason/ftp/sybase_ase_tech_talk.rss") +; my $ftp = Net::FTP->new("ftp.somewhere.com", Debug => 0) or die "Cannot connect to ftp.somewhere.com: $@"; $ftp->login('my_login','mypassword') or die "Cannot login ", $ftp->message; $ftp->cwd("rss") or die "Unable to change directory to /rss", $ftp- +>message; $ftp->put("/home/jason/ftp/sybase_ase_tech_talk.rss") or die "Cannot upload ase_tech_talk.rss", $ftp->me +ssage; $ftp->quit; }

Jason L. Froebe

Help find a cure for breast cancer! Net proceeds benefit the Susan G. Komen Breast Cancer Foundation and the National Philanthropic Trust. Help by donating - I'm walking 60 miles in 3 days in August 2007. (The day I return from TechWave is the first day of the Walk).

Blog, Tech Blog