summaryrefslogtreecommitdiff
path: root/rhimport-wl
diff options
context:
space:
mode:
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 91dd4ff..8769e81 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.com/rss/feed.xml";
+my $RSS_URL = "http://www.radiowienerlied.at/rss/podcast.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], 0);
+ @import_date = Date::Calc::Add_Delta_Days($today[0], $today[1], $today[2], 1);
$t = sprintf("%04d-%02d-%02d", $today[0], $today[1], $today[2]);
- $tfile = sprintf("[0-9-]+_%04d%02d%02d(-[0-9]+)?.mp3", $today[0], $today[1], $today[2]);
- print "looking for files from today in RSS Feed ($tfile)\n";
+ $tfile = sprintf("%04d%02d%02d.mp3", $today[0], $today[1], $today[2]);
+ print "looking for files from today in RSS Feed\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("[0-9-]+_%04d%02d%02d(-[0-9]+)?.mp3", $yesterday[0], $yesterday[1], $yesterday[2]);
- print "looking for files from yesterday in RSS Feed ($tfile)\n";
+ $tfile = sprintf("%04d%02d%02d.mp3", $yesterday[0], $yesterday[1], $yesterday[2]);
+ print "looking for files from yesterday in RSS Feed\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 !~ $tfile); # file not from today/yesterday
+ next if($ff->output_file ne $tfile); # file not from today/yesterday
my $sum_title = $entry->title;
my $sum_text = $entry->content->body;