aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fetch-comments-24hs
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-11-19 12:20:55 +0000
committerStruan Donald <struan@exo.org.uk>2012-11-19 12:20:55 +0000
commit468f89a56ad2cc69ec4ad4904a18dcf891a505cd (patch)
treee0f69cec5ddb98e9e2920c51eb92c00075757559 /bin/fetch-comments-24hs
parent136fd944c596e6cebd5127955fb507ae155725c1 (diff)
parentb81ba9819a4f33c21354617538a545a6520eb4d1 (diff)
Merge branch 'stevenage'
Conflicts: .gitignore bin/make_css conf/crontab.ugly perllib/FixMyStreet/Cobrand/Default.pm perllib/Open311.pm templates/web/fixmystreet/around/postcode_form.html
Diffstat (limited to 'bin/fetch-comments-24hs')
-rw-r--r--bin/fetch-comments-24hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/bin/fetch-comments-24hs b/bin/fetch-comments-24hs
new file mode 100644
index 000000000..b84f09ba7
--- /dev/null
+++ b/bin/fetch-comments-24hs
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use DateTime;
+use DateTime::Format::W3CDTF;
+require 5.8.0;
+
+use FixMyStreet::App;
+use CronFns;
+my ($verbose, $nomail) = CronFns::options();
+
+use Open311;
+use Open311::GetServiceRequestUpdates;
+
+my $dt = DateTime->now();
+my $dt_24hrs_ago = $dt->clone;
+$dt_24hrs_ago->add( hours => -24 );
+
+my $updates = Open311::GetServiceRequestUpdates->new(
+ verbose => 1,
+ start_date => DateTime::Format::W3CDTF->format_datetime( $dt_24hrs_ago ),
+ end_date => DateTime::Format::W3CDTF->format_datetime( $dt )
+);
+
+$updates->fetch;