diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-03-12 23:34:22 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-03-12 23:34:22 (GMT) |
commit | 5811d4baa233e24fa09cbf2bf0d398a2221d9e56 (patch) | |
tree | 60f90404295334c2d3e8edcbf8890249b7caeed9 | |
parent | 7e98159beb298a064878508e5e97fa2c060e4885 (diff) |
onda-info is now tested as well - note will only be set when import was successful
-rwxr-xr-x | rhautoimport-oi | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rhautoimport-oi b/rhautoimport-oi index fe8601f..3cd8ad3 100755 --- a/rhautoimport-oi +++ b/rhautoimport-oi @@ -89,6 +89,9 @@ my $feed = rhautoimport::fetch_parse_rss($RSS_URL) my $uri = ""; my $file = ""; +my $sum_title = ""; +my $sum_text = ""; + for my $entry ($feed->entries) { if($entry->enclosure) { print $entry->enclosure->url . "\n"; @@ -103,11 +106,9 @@ for my $entry ($feed->entries) { exit 1; } - my $sum_title = decode_entities($entry->title); - my $sum_text = decode_entities($entry->content->body); + $sum_title = decode_entities($entry->title); + $sum_text = decode_entities($entry->content->body); print "summary:\n" . $sum_title . "\n\n" . $sum_text . "\n"; - rhautoimport::pv_add_note($sum_title, $sum_text, $PV_ID, $id, "1"); - last; } } @@ -121,16 +122,18 @@ if($uri eq "") { exit 1; } -print "will import '$uri' to show $show_id, $show_title\n\n"; +print "\n\nwill import '$uri' to show $show_id, $show_title\n\n"; my ($ret, $log) = rhautoimport::import_uri($show_id, $uri->as_string); if($ret) { print "\nImport Error:\n\n"; print $log; + print "\n\nNot adding PV note!!"; exit 1; } print "\nImport Success:\n\n"; print $log; +rhautoimport::pv_add_note($sum_title, $sum_text, $PV_ID, $id, "1"); unlink($STAT_FILE); open(my $fhs, '>', $STAT_FILE); |