summaryrefslogtreecommitdiff
path: root/rhimport-zfw
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2013-03-19 00:57:38 (GMT)
committerChristian Pointner <equinox@helsinki.at>2013-03-19 00:57:38 (GMT)
commit8a971b1e5429b4e26a09f43495a50c3bbe7f7957 (patch)
treec6b4fda1b8941bb03ffbe22e3155ca40ca8dbba9 /rhimport-zfw
parentaa247d1c2b41265fd74e8f79e79cc87040d75598 (diff)
fixed rhimport-zfw
Diffstat (limited to 'rhimport-zfw')
-rwxr-xr-xrhimport-zfw5
1 files changed, 3 insertions, 2 deletions
diff --git a/rhimport-zfw b/rhimport-zfw
index a0759a7..012db4b 100755
--- a/rhimport-zfw
+++ b/rhimport-zfw
@@ -24,6 +24,7 @@
use strict;
use DBI;
use Date::Calc;
+use Time::localtime;
use XML::Feed;
use XML::Feed::Entry;
use XML::Feed::Content;
@@ -85,7 +86,7 @@ if(localtime->hour >= 12) {
print "day of original broadcast: " . Date::Calc::Date_to_Text(@broadcast_day) . "\n";
print "day of Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@import_day) . "\n";
-my $id = sprintf("%04d-%02d-%02d", $import_date[0], $import_date[1], $import_date[2]);
+my $id = sprintf("%04d-%02d-%02d", $import_day[0], $import_day[1], $import_day[2]);
my $bd = sprintf("%04d-%02d-%02d", $broadcast_day[0], $broadcast_day[1], $broadcast_day[2]);
print "looking for files from $bd in RSS Feed\n";
print " -> $RSS_URL\n";
@@ -114,7 +115,7 @@ for my $entry ($feed->entries) {
my $ff = File::Fetch->new(uri => $url);
next unless (uc($ff->output_file) =~ $bdfile); # file not from correct day
- my $sum_title = decode_entities($entry->title);
+ my ($sum_title, $sum_title_rest) = split(/:/, decode_entities($entry->title), 2);
my $sum_text = decode_entities($entry->content->body);
my $current_stat = `cat $STAT_FILE`;