summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrhimport-dn13
1 files changed, 8 insertions, 5 deletions
diff --git a/rhimport-dn b/rhimport-dn
index dce71bc..53e1e34 100755
--- a/rhimport-dn
+++ b/rhimport-dn
@@ -83,6 +83,7 @@ my $feed = XML::Feed->parse(URI->new($RSS_URL))
or die "Error fetching feed: " . XML::Feed->errstr;
my $file = "";
+my $out_file = "";
for my $entry ($feed->entries) {
if($entry->enclosure && $entry->enclosure->type eq "audio/mpeg") {
my $sum_title = $entry->title;
@@ -99,15 +100,12 @@ for my $entry ($feed->entries) {
$dbh->disconnect();
exit 0;
}
- unlink($STAT_FILE);
- open(my $fhs, '>', $STAT_FILE);
- print $fhs $ff->output_file;
- close($fhs);
+ $out_file = $ff->output_file;
print $1 . ": downloading " . $entry->enclosure->url . " (" . $entry->enclosure->length . " Bytes) .. ";
$file = $ff->fetch( to => '/tmp' ) or die $ff->error;
print "ok\n";
-
+
print "summary:\n" . $sum_title . "\n\n" . $sum_text . "\n";
push(@PV_SCRIPT, sprintf("%04d-%02d-%02d", $today[0], $today[1], $today[2]));
@@ -165,4 +163,9 @@ if(!$ret) {
exit 1;
}
+unlink($STAT_FILE);
+open(my $fhs, '>', $STAT_FILE);
+print $fhs $out_file;
+close($fhs);
+
exit 0;