summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2019-11-27 11:04:37 (GMT)
committerChristian Pointner <equinox@helsinki.at>2019-11-27 11:04:37 (GMT)
commit40b26ee29e015d3c3bd8808b0853855b72a3a0c8 (patch)
tree394cdf904800f5cca3acf250f97b5dffb3ee110d
parent8e4321dc206024a4967fb9e695921137f80af68f (diff)
onda-info: use title not filename
-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;