summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2013-03-14 17:34:10 (GMT)
committerChristian Pointner <equinox@helsinki.at>2013-03-14 17:34:10 (GMT)
commitf8894cb574e88ae3495f914b78c2c7653d73b3e5 (patch)
tree9de8ac6e3202821f2406e4505009f842dc4e1b57
parent178a9fbb4f2f1dcd1ac4a29030e7194a9920b3da (diff)
export last note of zip fm for rebroadcasts
-rwxr-xr-xfetch-files-cba.pl7
-rwxr-xr-xrhimport-zf25
2 files changed, 13 insertions, 19 deletions
diff --git a/fetch-files-cba.pl b/fetch-files-cba.pl
index ccb7d7e..4aaa227 100755
--- a/fetch-files-cba.pl
+++ b/fetch-files-cba.pl
@@ -44,7 +44,7 @@ if(@ARGV == 0) {
exit 1;
}
-my $RSS_URL = "http://cba.fro.at/seriesrss/$ARGV[0]?dev=true";
+my $RSS_URL = "http://cba.fro.at/seriesrss/$ARGV[0]?dev=true&limit=10000";
print "Fetching files form '$RSS_URL'\n";
my $feed = XML::Feed->parse(URI->new($RSS_URL))
@@ -64,6 +64,11 @@ for my $entry ($feed->entries) {
$url = $1 . $2;
}
+ # if($i <= 100) {
+ # print" --> skipping " . $url . "\n";
+ # last;
+ # }
+
my $ff = File::Fetch->new(uri => $url);
print " --> downloading " . $url . " (" . $enclosure->length . " Bytes) .. ";
my $file = $ff->fetch() or die $ff->error;
diff --git a/rhimport-zf b/rhimport-zf
index 13419e2..7ebfa5e 100755
--- a/rhimport-zf
+++ b/rhimport-zf
@@ -42,6 +42,7 @@ my $DBPW = "lldriven";
my $DB = "rivendell";
my $STAT_FILE = $ENV{'HOME'} . "/rhimport-zf.stat";
+my $NOTE_FILE = $ENV{'HOME'} . "/rhimport-zf.last_note";
my $RSS_URL = "http://freie-radios.net/portal/podcast.php?serie=53&rss";
my $PV_ID = '300';
@@ -76,20 +77,12 @@ my @this_mon = Date::Calc::Business_to_Standard(@tmp);
my @next_mon = Date::Calc::Add_Delta_Days($this_mon[0], $this_mon[1], $this_mon[2], 7);
my @broadcast_day = @today;
-my @rebroadcast_day = @tomorrow;
-if($dow == 5) {
- @rebroadcast_day = @next_mon;
-}
-
print "day of broadcast: " . Date::Calc::Date_to_Text(@broadcast_day) . "\n";
-# TODO: REBROADCAST
-#print "day of rebroadcast: " . Date::Calc::Date_to_Text(@rebroadcast_day) . "\n";
for my $href ( @allowed_dbs ) {
if ($dow == int(substr($href->{'NAME'},0,2))) {
$dropbox = $href->{'PATH'};
$to_cart = $href->{'TO_CART'};
-## TODO: get right cart for rebroadcast
}
}
@@ -132,9 +125,12 @@ for my $entry ($feed->entries) {
rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $broadcast_day[0], $broadcast_day[1], $broadcast_day[2]), "1");
print "\n";
-# TODO: REBROADCAST
-# rhimport::pv_add_note($sum_title, $sum_text, $PV_ID, sprintf("%04d-%02d-%02d", $rebroadcast_day[0], $rebroadcast_day[1], $rebbroadcast_day[2]), "2");
-# print "\n";
+
+ unlink($NOTE_FILE);
+ open(my $fhs, '>', $NOTE_FILE);
+ binmode($fhs, ":utf8");
+ print $fhs $sum_title . "\n\n" . $sum_text . "\n";
+ close($fhs);
last;
}
@@ -150,8 +146,6 @@ if($file eq "" || !(-e "$file")) {
}
print "will import $file to dropbox $dropbox (cart=$to_cart)\n";
-# TODO: REBROADCAST
-#print "will import $file to rebroadcast dropbox $dropbox_reb (cart=$to_cart_reb)\n\n";
my $error_cb = sub {
my ($text) = @_;
@@ -167,11 +161,6 @@ my $log = rhimport::clear_carts($dbh, $group, $to_cart);
my $import_log;
($ret, $import_log) = rhimport::import_single($file, $dropbox, $user, 0, $error_cb);
$log .= $import_log;
-# TODO: REBROADCAST
-# $import_log = rhimport::clear_carts($dbh, $group, $to_cart_reb);
-# $log .= $import_log;
-# ($ret, $import_log) = rhimport::import_single($file, $dropbox_reb, $user, 0, $error_cb);
-# $log .= $import_log;
$dbh->disconnect();