PODCAST: “Too Jewish with Rabbi Sam Cohon and Friends” RSS feed working again

A while ago I wrote a Perl script that would create a RSS feed so I could listen to the podcast outside of iTunes (e.g. Miro).  It stopped a few months back when I moved servers.  It’s working again.

Can’t find a working RSS feed for the “Too Jewish with Rabbi Cohon” podcast? Here is a working RSS feed that is updated every Monday morning!

Miro Video Player

All 

Last 10 

Share Button

Video: Sun/Oracle’s Netbeans 6.7 and the GlassFish version 3 application server

Share Button

Source code for scraping the website of Too Jewish Radio program to create two RSS feeds (audio podcast)

Many of you have asked me for the source code of the Perl application I wrote for creating the two rss feeds ( All Episodes & Last 10 Episodes ) for the Too Jewish Radio program. Well, here ya go! Keep in mind that it was written quickly and really doesn’t have much in the line of robustness (no real error checking code, etc).

#!/usr/bin/perl

use strict;
use warnings;

use utf8;

use Config::Simple;
use Date::Manip qw( ParseDate UnixDate );
use Getopt::Std;
use LWP::Simple;
use Net::FTP;
use XML::LibXML;
use XML::RSS;
use URI;

use vars qw( $opt_h $opt_n $opt_o $opt_u $opt_c );

sub print_usage {
  print "-"x40 . "\n";
  print " "x10 . "too_jewish.pl\n";
  print "-"x40 . "\n";
  print " "x4 . "-n [# episodes] : Number of episodes to list in the RSS feed\n";
  print " "x4 . "-o [filename] : Save RSS feed to file\n";
  print " "x4 . "-u     : Upload RSS feed to ftp server\n";
  print " "x4 . "-c [cfg filename]: Read configuration from filename\n";
  print " "x4 . "-h     : Print help\n";
  print "-"x40 . "\n";
}

sub format_W3CDTF_date {
  my $orig_date = shift;

  my $w3cdtf_format = "%Y-%m-%d";
  my $tmp_date = ParseDate($orig_date);
  $tmp_date = UnixDate($tmp_date, $w3cdtf_format);

  return $tmp_date;
}

sub get_episode_data {
  my $num_episodes = shift;

  my $episode_data_ref;

  # Set up the parser, and set it to recover
  # from errors so that it can handle broken
  # HTML
  my $parser = XML::LibXML->new();
  $parser->recover(1);

  # Parse the page into a DOM tree structure
  my $url = 'http://www.toojewishradio.com/too_jewish_shows.htm';
  my $data = get($url) or die $!;
  my $doc = $parser->parse_html_string($data);

  # Extract the table rows (as an
  # array of referrences to DOM nodes)
  my @table_rows = $doc->findnodes( q{ /html/body/table/tr } );

  @table_rows = @table_rows[1..$#table_rows];

  foreach my $row (@table_rows) {
    my $row_date = $row->find('string(td[1]//font/font)')->value();
    next if $row_date =~ /^\s*$/;

    my $mp3_file = $row->find('string(td[2]/font//a[1]/@href)')->value();
    next if $mp3_file =~ /^\s*$/;

    my $description = $row->find('string(td[2]/font)')->value();
    next if $description =~ /^\s*$/;
    $description =~ s/\s+/ /g;
    $description =~ s/^\s+//;
    $description =~ s/\s+$//;

    my $abs_url_mp3 = URI->new($mp3_file)->abs($url)->as_string;

    push @$episode_data_ref, {
        'pubDate' => $row_date,
        'description' => $description,
        'url' => $abs_url_mp3
      };
  }

  if ($num_episodes) {
    @$episode_data_ref = @$episode_data_ref[0..$num_episodes-1];
  }

  return $episode_data_ref;
}

sub create_rss_feed {
  my ($episode_data_ref, $rss_filename) = @_;

  my $rss = new XML::RSS (version => '2.0');

  $rss->channel(
    title        => 'Too Jewish with Rabbi Cohon',
    link       => 'http://www.toojewishradio.com',
    description  => '"Too Jewish" with Rabbi Sam Cohon and Friends plays every Sunday morning at 7:00 am on radio station KAPR 930 AM in Douglas, Bisbee, and Sierra Vista at 9:00 am, on KJAA 1240 AM in Globe at 9:00 am, and at 9:00 am on radio station KVOI AM 690 in Tucson.

"Too Jewish" is a lively and fast-paced show that highlights everything interesting in contemporary Jewish life and features music, arts, culture, comedy, and inspiration. "Too Jewish" is a blend of information, irreverence, and exploration of all things Jewish in the 21st century. "Too Jewish" makes Judaism accessible, interesting, and fun for listeners of all ages and backgrounds, and brings the best of Jewish experience vividly to life. But on "Too Jewish", Rabbi Cohon also challenges accepted pieties and has fun with anything boring or inauthentic in the way Jews live today in the United States, Israel, and everywhere else.

Since its Tucson debut August 4, 2002, "Too Jewish" has featured such prominent guests as legendary singer and recording artist Neil Sedaka, Kinky Friedman, Elie Wiesel, comedian Lily Tomlin, folksinger Peter Yarrow, NPR Supreme Court Expert Nina Totenberg, Eve Ensler, U.S. Senator Russ Feingold, and many more!

Regular expert commentators of the "Too Jewish" maven section include Tom Price, an educator and former diplomat who offers unique insights into Jewish life around the world, and Amy Hirshberg Lederman, nationally syndicated columnist, who shares stories which speak to the heart of Jewish listeners. Comedy and musical selections drawn by Rabbi Cohon from the remarkable range of great Jewish material help make listening to "Too Jewish" an exciting and fun experience.',
    dc => {
        date     => format_W3CDTF_date('now'),
        subject   => 'Jewish Radio',
        creator   => 'toojewishradio@yahoo.com',
        publisher   => 'toojewishradio@yahoo.com',
        rights   => 'All Rights Reserved, toojewishradio@yahoo.com',
        language  => 'en-us',
      },
    sync => {
        updatePeriod   => 'weekly',
        updateFrequency => '1',
        updateBase      => format_W3CDTF_date('01/01/1901'),
      },
    taxo => [
        'http://www.templeemanueltucson.org',
        'http://www.toojewishradio.com/about_the_rabbi.htm'
      ],
    );

  $rss->image(
    title => 'Too Jewish with Rabbi Cohon',
    url    => 'http://www.toojewishradio.com/Too%20Jewish%20logo_color.jpg',
    link => 'http://www.templeemanueltucson.org',
    dc => {
      creator => 'toojewishradio@yahoo.com'
      },
    );

  foreach my $episode (@$episode_data_ref) {
    $rss->add_item(
      title        => $episode->{description},
      enclosure     => {
        url    => $episode->{url},
        type => "audio/mpeg"
        },
      description => $episode->{description},
      pubDate     => format_W3CDTF_date( $episode->{pubDate} )
      );
  }

  if ($rss_filename) {
    $rss->save($rss_filename);
  }

  return $rss->as_string;
}

sub upload_rss_file {
  my ($ftp_server, $rss_filename) = @_;

  my $ftp = Net::FTP->new( $ftp_server->{server}, Debug => 0)
    or die "Cannot connect to $ftp_server->{server}: $@";
  $ftp->login( $ftp_server->{user}, $ftp_server->{password})
    or die "Cannot login ", $ftp->message;
  $ftp->cwd($ftp_server->{dir})
    or die "Unable to change directory to $ftp_server->{dir}", $ftp->message;
  $ftp->put($rss_filename)
    or die "Cannot upload $rss_filename", $ftp->message;
  $ftp->quit;
}

my $num_episodes;
my $ftp_server;
my $rss_filename;
my $upload;

if (getopts('hc:n:o:u')) {
  if ($opt_h) {
    print_usage;
    exit;
  }

  if ($opt_n) {
    if ($opt_n =~ /^[[:digit:]]+$/) {
      $num_episodes = $opt_n;
    }
  }

  if ($opt_o) {
    $rss_filename = $opt_o;
  }

  if ($opt_u) {
    $upload = 1;

    my $cfg_filename;

    if ($opt_c && -f $opt_c) {
      $cfg_filename = $opt_c;
    } else {
      $cfg_filename = '.too_jewish.ini';
    }

    my $cfg = new Config::Simple($cfg_filename);

    if ($cfg &&
        $cfg->param('RSS.ftp_server') && $cfg->param('RSS.ftp_user') &&
        $cfg->param('RSS.ftp_password') && $cfg->param('RSS.ftp_dir')
      ) {
      $ftp_server = {
        server   => $cfg->param('RSS.ftp_server'),
        user     => $cfg->param('RSS.ftp_user'),
        password  => $cfg->param('RSS.ftp_password'),
        dir        => $cfg->param('RSS.ftp_dir')
        };
    } else {
      print "Configuration file \"$cfg_filename\" does not contain a valid configuration!\n";
      exit;
    }
  }
}

my $rss_string = create_rss_feed( get_episode_data($num_episodes), $rss_filename );

if ($rss_filename && $upload && -f $rss_filename) {
  upload_rss_file($ftp_server, $rss_filename);
} else {
  print "$rss_string\n" unless $rss_filename;
}
Share Button

Can’t find a working RSS feed for the “Too Jewish with Rabbi Cohon” podcast? Here is a working RSS feed that is updated every Monday morning!

A long time ago when I used iTunes on my WinXP laptop I was able to subscribe to the Too Jewish with Rabbi Sam Cohon & Friends podcast through the iTunes Store.  Since my main desktop runs Ubuntu Linux 9.04 and the RhythmBox Music Player is unable to retrieve podcast from the iTunes Store, I was at a loss as to how to listen to the podcast.

I sent numerous emails to the webmasters at toojewishradio@yahoo.com requesting a RSS feed of the podcast to no avail.  So… I wrote a small Perl application to create two RSS feeds:

  • All Episodes
  • Last 10 Episodes

Please note that I’m only generating and hosting the RSS feeds and NOT the podcast files.  The podcast is a product of Temple Emanu-El.
Update: The source code is available at  Source code for scraping the website of Too Jewish Radio program to create two RSS feeds (audio podcast)

Share Button

Fast Foward Radio – a positive take on the future with Phil Bowermaster & Stephen Gordon

I recently came across Fast Forward Radio by Phil Bowermaster and Stephen Gordon.  I hope you enjoy their podcast as much as I do 🙂

Tune in every Sunday evening for a positive take on the future with Phil Bowermaster, Stephen Gordon, and some of the most fascinating people helping to shape the world that’s coming.

Fast Forward Radio
Fast Forward Radio

Share Button

GeekBrief.tv: Check out the USB drive -> NAS adapter ($55) and the free Microsoft PowerPoint -> Flash software

Thanks to the all knowing Cali Lewis for hosting GeekBrief.tv!

The Addonics NAS Adapter turns a USB drive in NAS, and it only costs $55.

If you do a lot of Powerpoint presentations, you’ll be happy to hear about iSpring Free. It turns the presentation into a Flash movie that you can embed into a blog post and share.

Share Button

AudioBook Review: AmerIndian 2192 by J. Scott Garibay

I just finished the audio book AmerIndian 2192 by J. Scott Garibay while commuting to work.  Garibay is a new author and I have to say I’m very impressed.

The story is easy to follow with the exception of the flashbacks to 20 years prior (during the White Earth massacre segments).  There wasn’t a clear transition between the present and the flashback.  I assume there was in the printed book.  Perhaps a 5 second delay in the audio or similar could be performed in future audiobooks.

I had trouble with dialog of the Admiral Lye character.  He appears to be a cross between Captain Ahab, General Custer and Darth Vader.  I believe that the point of view of such a butcher is alien to the author… making it difficult for the dialog to be largely believable.  Fortunately, the dialog of Admiral Lye is short.  I’m hoping Garibay is able to revisit Admiral Lye in future novels…  the character has a great deal of potential (how did Lye become what he did?).

The AmerIndian Confederacy (AC) was created by the AmerIndian tribals to regain their homeland.  The problem, albeit a minor problem, is that we’re not given any real incite on how they became a power in the universe – it was created twenty odd years prior and now is able to take on Earth?  The AC is a utopian society, a highly successful business, a mercenary group, and a terrorist group.

The premise:

AmerIndian 2192 is a science-fiction novel that explores the intriguing possibilities of Native Americans in mankind’s star flung future. AmerIndian 2192 presents the story of two brothers, Wovoka and Keokuk, restoring the Native American people to a Homeland where their vibrant culture can thrive. Lodge ships, Cybershaman rituals and Tsimshian high technology are all elements in this action-oriented tale of interstellar politics and personal struggles.  — Podiobooks.com

I would put it differently:

AmerIndian 2192 is the story of the rebirth of pre-Columbian Native American culture and a homeland in a far flung galaxy.  The price required by the Grand Fathers nearly destroys the homeland after the Ghost Dance ritual is performed.

The narrator, LeighAnn Garibay, performed quite well but it is obvious she isn’t a professional narrator.  She doesn’t have to be for this novel.  Kudos to her!

The audiobook on Podiobooks.com easily leaves room for a sequel (please let there be one!).  What happens to the UDA, the clones, and the Admiral Lye (sp)?  Does Wovoka ever find peace?  How many of the tribals fail transition to the new life even though they try?  The author has the opportunity to make a “Garibay” universe here.

I would love to see short stories related to AmerIndian 2192 by Garibay and other authors (fan fiction).

I definitely recommend this audiobook! 🙂

Share Button