diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-06-02 12:55:15 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-06-02 12:55:15 (GMT) |
commit | 09366a29099c1ee03ecb6cfa1583f8ae319c2f15 (patch) | |
tree | 5f71f0f65a7109e6c1693959e5da0bc02637e333 /rhautoimport-po | |
parent | 2d1d346df2b40eecfc82803d57f15a3165cdf898 (diff) |
enabled panoptikum importer
Diffstat (limited to 'rhautoimport-po')
-rwxr-xr-x | rhautoimport-po | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/rhautoimport-po b/rhautoimport-po index 1058f19..e754f86 100755 --- a/rhautoimport-po +++ b/rhautoimport-po @@ -37,23 +37,25 @@ use lib '/usr/local/share/rhautoimport/'; use rhautoimport; my $STAT_FILE = $ENV{'HOME'} . "/rhautoimport-po.stat"; -my $RSS_URL = "https://cba.fro.at/series/werkstatt-radio/feed?c=Kfs2IoV2Wmd"; +my $RSS_URL = "https://cba.fro.at/series/panoptikum-bildung/feed?c=Kfs2IoV2Wmd"; $XML::Feed::MULTIPLE_ENCLOSURES=1; my $RD_GROUP = "panoptikum"; -my $PV_ID = '9999'; +my $PV_ID = '570'; my $LAST_RUN = 0; binmode(STDIN, ":utf8"); binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); -if($#ARGV >= 0 && $ARGV[0] eq 'last') { - print "!!!This is the last attempt, there won't be a retry on error!!!\n"; - $LAST_RUN = 1; -} - my $curweek = RHRD::utils::get_rd_week(); +if($curweek == 2 || $curweek == 4) { + if($#ARGV >= 0 && $ARGV[0] eq 'last') { + print "!!!This is the last attempt, there won't be a retry on error!!!\n"; + $LAST_RUN = 1; + } +} + my @today = Date::Calc::Today(); print "today: " . Date::Calc::Date_to_Text(@today) . " (Week: " . $curweek . ")\n"; @@ -72,7 +74,6 @@ if($curweek == 2 || $curweek == 4) { print "day of next Radio Helsinki broadcast: " . Date::Calc::Date_to_Text(@import_date) . "\n"; - my @allowed_dbs = rhautoimport::get_dropboxes($RD_GROUP); if(!defined $allowed_dbs[0] && defined $allowed_dbs[1]) { print "$allowed_dbs[1]\n"; @@ -87,13 +88,6 @@ my $show_id = $allowed_dbs[0]->{'SHOWID'}; my $show_title = $allowed_dbs[0]->{'SHOWTITLE'}; my @broadcast_date = Date::Calc::Nth_Weekday_of_Month_Year($import_date[0], $import_date[1], 5, 1); -if(Date::Calc::Delta_Days(@broadcast_date, @import_date) <= 0) { - my @tmp_date = Date::Calc::Add_Delta_YM(@broadcast_date, 0, -1); - @broadcast_date = Date::Calc::Nth_Weekday_of_Month_Year($tmp_date[0], $tmp_date[1], 1, 3); -} - - -my @broadcast_date = Date::Calc::Nth_Weekday_of_Month_Year($import_date[0], $import_date[1], 5, 1); if(Date::Calc::Delta_Days(@broadcast_date, @import_date) > 0) { my @tmp_date = Date::Calc::Nth_Weekday_of_Month_Year($import_date[0], $import_date[1], 5, 3); if(Date::Calc::Delta_Days(@tmp_date, @import_date) > 0) { |