diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-03-12 23:26:00 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-03-12 23:26:00 (GMT) |
commit | 7e98159beb298a064878508e5e97fa2c060e4885 (patch) | |
tree | e33c38a154994ddb7af2e3f106a0984f67949b5c /rhautoimport-nw | |
parent | f366fc3929ad85a6b1f74baf4e62e86d651fe0f7 (diff) |
netwatcher is now tested as well - note will only be set when import was successful
Diffstat (limited to 'rhautoimport-nw')
-rwxr-xr-x | rhautoimport-nw | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/rhautoimport-nw b/rhautoimport-nw index 4642707..2fbc9c8 100755 --- a/rhautoimport-nw +++ b/rhautoimport-nw @@ -83,6 +83,9 @@ my $feed = rhautoimport::fetch_parse_rss($RSS_URL) my $uri = ""; my $file = ""; +my $sum_title = ""; +my $sum_text = ""; + my $i = 0; for my $entry ($feed->entries) { $i++; @@ -112,18 +115,16 @@ 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; } } last if $file ne ""; } if($uri eq "") { - print "No Entry found from $bd or download error - "; + print "No Entry found from $bd - "; if($#ARGV >= 0 && $ARGV[0] eq 'last') { print "giving up, manual import necessary!!!\n"; } else { @@ -132,16 +133,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); |