summaryrefslogtreecommitdiff
path: root/rhimport-wl
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2012-05-07 10:18:48 (GMT)
committerChristian Pointner <equinox@helsinki.at>2012-05-07 10:18:48 (GMT)
commit99f48d56488c725c839d85fbaaf64c1cdebfa597 (patch)
tree9f32a78c076e09eb3d119d2c566dfa9448ba7ae6 /rhimport-wl
parent0414ed12b32e6ed201c4fd3c22c4bc7746cadb9a (diff)
fixed rhimport-wl (changed rss feed)
Diffstat (limited to 'rhimport-wl')
-rwxr-xr-xrhimport-wl14
1 files changed, 7 insertions, 7 deletions
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;