From 99f48d56488c725c839d85fbaaf64c1cdebfa597 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 7 May 2012 10:18:48 +0000 Subject: fixed rhimport-wl (changed rss feed) diff --git a/rhimport-wl b/rhimport-wl index 8769e81..aac05bb 100755 --- a/rhimport-wl +++ b/rhimport-wl @@ -41,7 +41,7 @@ my $DBPW = "lldriven"; my $DB = "rivendell"; my $STAT_FILE = $ENV{'HOME'} . "/rhimport-wl.stat"; -my $RSS_URL = "http://www.radiowienerlied.at/rss/podcast.xml"; +my $RSS_URL = "http://www.radiowienerlied.com/rss/feed.xml"; my $PV_ID = '82'; binmode(STDIN, ":utf8"); @@ -71,16 +71,16 @@ my $t; my $tfile; if(Date::Calc::Day_of_Week(@today) == 7) { - @import_date = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], 1); + @import_date = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], 0); $t = sprintf("%04d-%02d-%02d", $today[0], $today[1], $today[2]); - $tfile = sprintf("%04d%02d%02d.mp3", $today[0], $today[1], $today[2]); - print "looking for files from today in RSS Feed\n"; + $tfile = sprintf("[0-9-]+_%04d%02d%02d(-\d+)?.mp3", $today[0], $today[1], $today[2]); + print "looking for files from today in RSS Feed ($tfile)\n"; } elsif(Date::Calc::Day_of_Week(@today) == 1) { my @yesterday = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], -1); @import_date = @today; $t = sprintf("%04d-%02d-%02d", $yesterday[0], $yesterday[1], $yesterday[2]); - $tfile = sprintf("%04d%02d%02d.mp3", $yesterday[0], $yesterday[1], $yesterday[2]); - print "looking for files from yesterday in RSS Feed\n"; + $tfile = sprintf("[0-9-]+_%04d%02d%02d(-\d+)?.mp3", $yesterday[0], $yesterday[1], $yesterday[2]); + print "looking for files from yesterday in RSS Feed ($tfile)\n"; } else { print "it's neither Sunday nor Monday, please check cron script"; exit 1; @@ -95,7 +95,7 @@ my $out_file = ""; for my $entry ($feed->entries) { if($entry->enclosure && $entry->enclosure->type eq "audio/mpeg") { my $ff = File::Fetch->new(uri => $entry->enclosure->url); - next if($ff->output_file ne $tfile); # file not from today/yesterday + next if($ff->output_file !~ $tfile); # file not from today/yesterday my $sum_title = $entry->title; my $sum_text = $entry->content->body; -- cgit v0.10.2