diff options
author | Christian Pointner <equinox@helsinki.at> | 2013-03-14 17:34:10 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2013-03-14 17:34:10 (GMT) |
commit | f8894cb574e88ae3495f914b78c2c7653d73b3e5 (patch) | |
tree | 9de8ac6e3202821f2406e4505009f842dc4e1b57 /rhimport-zf | |
parent | 178a9fbb4f2f1dcd1ac4a29030e7194a9920b3da (diff) |
export last note of zip fm for rebroadcasts
Diffstat (limited to 'rhimport-zf')
-rwxr-xr-x | rhimport-zf | 25 |
1 files changed, 7 insertions, 18 deletions
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(); |