summaryrefslogtreecommitdiff
path: root/rhimport.pm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-07-24 21:25:25 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-07-24 21:25:25 (GMT)
commit8c27798a5fa60ed7f0d1babc5391b26b68b9a7e1 (patch)
tree72349c00e25e83422676a74c1272d257045dd9f0 /rhimport.pm
parent6761a44cfb25af3f923a53375f05e75e8570403d (diff)
moved get_rd_week to RHRD as well
Diffstat (limited to 'rhimport.pm')
-rw-r--r--rhimport.pm30
1 files changed, 0 insertions, 30 deletions
diff --git a/rhimport.pm b/rhimport.pm
index 353b75d..09c5082 100644
--- a/rhimport.pm
+++ b/rhimport.pm
@@ -30,9 +30,6 @@ use IPC::Open3;
use File::Spec;
use File::Basename;
use URI::Escape;
-use POSIX;
-use DateTime;
-use DateTime::TimeZone;
use LWP::Simple;
use XML::Feed;
@@ -42,33 +39,6 @@ my $ssh_key_file = "$ENV{'HOME'}/.rhimport/import.key";
my $ssh_dir = "/programm/.rhimport";
my $rdimport_wrapper = "/usr/local/bin/dropbox_newfile.pl";
-sub get_rd_week
-{
- #
- # This computes the current Rivendell Week based on the number
- # of weeks since epoch.
- #
- # Explanation:
- # epoch was at 01.01.1970 which was a Thursday.
- # Monday in that week is (s-from-epoch + 3*24*60*60) seconds ago.
- # This needs to be adjusted by the timezone offset for Europe/Vienna
- # which is of course not constant (damn you daylight savings time)
- # Divide this by (7*24*60*60) and you get the number of
- # weeks since the Monday in the week of epoch adjusted for timezone offsets.
- # This week had week number 3 so add an offset of 2 and
- # get the modulo of 4. This rounded down gives you the current week
- # with 0 meaning Week 1. So add 1 to that number and you will get
- # the current RD week.
- #
- my $now = DateTime->now();
- my $tz = DateTime::TimeZone->new(name => 'Europe/Vienna');
- my $tz_offset = $tz->offset_for_datetime($now);
- my $sEpoch = $now->epoch() + $tz_offset;
- my $week = floor(((($sEpoch + 259200)/604800) + 2) % 4) + 1;
-
- return $week;
-}
-
sub fetch_parse_rss
{
my ($url, $ua_str) = @_;