diff options
-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); |