aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/fetch-comments-24hs26
-rwxr-xr-xbin/make_css2
-rwxr-xr-xbin/open311-populate-service-list2
-rwxr-xr-xbin/send-comments13
4 files changed, 41 insertions, 2 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;
diff --git a/bin/make_css b/bin/make_css
index 392d7d7d7..a86fd4f0d 100755
--- a/bin/make_css
+++ b/bin/make_css
@@ -14,7 +14,7 @@
DIRECTORY=$(cd `dirname $0`/../web && pwd)
# FixMyStreet uses compass
-NEWSTYLE=${1:-"fixmystreet bromley fixmybarangay barnet zurich default"}
+NEWSTYLE=${1:-"fixmystreet bromley fixmybarangay barnet zurich default stevenage"}
NEWSTYLE_REGEX=${NEWSTYLE// /\\|}
for site in $NEWSTYLE; do
compass compile --output-style compressed $DIRECTORY/cobrands/$site
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index 392b86dbd..232b0a6d4 100755
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
use strict;
use warnings;
diff --git a/bin/send-comments b/bin/send-comments
index b054ebd8f..4955cb2f3 100755
--- a/bin/send-comments
+++ b/bin/send-comments
@@ -41,6 +41,7 @@ my $councils = FixMyStreet::App->model('DB::Open311Conf')->search( {
} );
while ( my $council = $councils->next ) {
+ my $use_extended = 0;
my $comments = FixMyStreet::App->model('DB::Comment')->search( {
'me.whensent' => undef,
'me.external_id' => undef,
@@ -56,12 +57,24 @@ while ( my $council = $councils->next ) {
}
);
+ if ( $council->area_id == 2482 ) {
+ $use_extended = 1;
+ }
+
my $o = Open311->new(
endpoint => $council->endpoint,
jurisdiction => $council->jurisdiction,
api_key => $council->api_key,
+ use_extended_updates => $use_extended,
);
+ if ( $council->area_id =~ /2482/ ) {
+ my $endpoints = $o->endpoints;
+ $endpoints->{update} = 'update.xml';
+ $endpoints->{service_request_updates} = 'update.xml';
+ $o->endpoints( $endpoints );
+ }
+
while ( my $comment = $comments->next ) {
my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($comment->cobrand)->new();