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


In reply to Fixing a RSS podcast feed by jfroebe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.