summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-06-12 08:40:36 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-06-12 08:40:36 (GMT)
commit2124e208d8f5279626fa1d2a8318d5fbc82a82d0 (patch)
tree3ea0ab789ea83856dec4b05be613a20f3191b4be
parent2c5f9b70e4616e512c5d17696760096f553363f0 (diff)
fix women on-air importer
-rwxr-xr-xrhautoimport-gd13
1 files changed, 12 insertions, 1 deletions
diff --git a/rhautoimport-gd b/rhautoimport-gd
index cc9256f..2bacb53 100755
--- a/rhautoimport-gd
+++ b/rhautoimport-gd
@@ -71,8 +71,16 @@ my $show_title_reb = $allowed_dbs[$idx_reb]->{'SHOWTITLE'};
my @today = Date::Calc::Standard_to_Business(Date::Calc::Today());
+my $dow = $today[2];
+if($dow > 1 && $dow < 5) {
+ print "please don't run this script Tuesday, Wednesday or Thursday!\n";
+ exit 42;
+}
$today[2] = 2;
my @broadcast_day = Date::Calc::Business_to_Standard(@today);
+if($dow == 1) {
+ @broadcast_day = Date::Calc::Add_Delta_Days(@broadcast_day, -7);
+}
my @import_date = Date::Calc::Add_Delta_Days(@broadcast_day, 6);
my @import_date_reb = Date::Calc::Add_Delta_Days(@import_date, 3);
print "day of original broadcast: " . Date::Calc::Date_to_Text(@broadcast_day) . "\n";
@@ -113,7 +121,10 @@ for my $entry ($feed->entries) {
$uri = new URI::URL($orig_uri);
my @path = $uri->path_components;
$file = $path[-1];
- next unless $file =~ /$bdexp/;
+ unless($file =~ /$bdexp/) {
+ $uri = "";
+ next;
+ }
my $current_file = `cat $STAT_FILE`;
if($current_file eq $file) {