summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrhautoimport-oi8
1 files changed, 5 insertions, 3 deletions
diff --git a/rhautoimport-oi b/rhautoimport-oi
index 5c01e9b..ebdb143 100755
--- a/rhautoimport-oi
+++ b/rhautoimport-oi
@@ -94,7 +94,7 @@ print "day of next Radio Helsinki rebroadcast: " . Date::Calc::Date_to_Text(@imp
print "Number of next original broadcast: " . $broadcast_num . "\n\n";
my $id = sprintf("%04d-%02d-%02d", @import_date);
-my $bdfile = sprintf('.*onda.?info[-_]%d.*\.mp3$', $broadcast_num);
+my $bdnumexp = sprintf('onda-info\s*%d', $broadcast_num);
my $current_stat = `cat $STAT_FILE`;
my ($current_id, $current_file) = $current_stat =~ m/^(.*)\n(.*)/;
@@ -103,7 +103,7 @@ if($current_id eq $id) {
exit 42;
}
-print "looking for files like '$bdfile' in RSS Feed\n";
+print "looking for title like '$bdnumexp' in RSS Feed\n";
print " -> $RSS_URL\n";
my ($result, $feed) = rhautoimport::fetch_parse_rss($RSS_URL);
@@ -120,7 +120,9 @@ my $sum_text = "";
for my $entry ($feed->entries) {
if($entry->enclosure) {
print $entry->enclosure->url . "\n";
- next unless $entry->enclosure->url =~ /$bdfile/;
+
+ $sum_title = decode_entities($entry->title);
+ next unless $sum_title =~ /$bdnumexp/;
$uri = new URI::URL($entry->enclosure->url);
my @path = $uri->path_components;