summaryrefslogtreecommitdiff
path: root/rhautoimport-oi
diff options
context:
space:
mode:
Diffstat (limited to 'rhautoimport-oi')
-rwxr-xr-xrhautoimport-oi13
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);