aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fetch-reports
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-12-20 15:58:51 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-15 13:17:18 +0000
commit935f431ee0da77dd26a78b959d3b9afb89665c0f (patch)
tree68b4b80d88cfcd9f2915f091b16927a00f2a0680 /bin/fetch-reports
parent40a3bfb7566b02db2eb6019adcbefeaa19ffb42f (diff)
fetch new problems over open311
This enables the display of existing reports from the back end on FMS if the body is configured to do this. Reports will not be created if they are missing an id, a lat or a long, if the lat/long is outside the area covered by the body, if there is already a report with a matching id, or if we can't parse out the request time.
Diffstat (limited to 'bin/fetch-reports')
-rwxr-xr-xbin/fetch-reports25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/fetch-reports b/bin/fetch-reports
new file mode 100755
index 000000000..665b4aff0
--- /dev/null
+++ b/bin/fetch-reports
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+#
+# This script utilises the Open311 extension explained at
+# https://github.com/mysociety/FixMyStreet/wiki/Open311-FMS---Proposed-differences-to-Open311
+# to fetch updates on service requests.
+
+use strict;
+use warnings;
+require 5.8.0;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
+use CronFns;
+my ($verbose, $nomail) = CronFns::options();
+
+use Open311::GetServiceRequests;
+
+my $reports = Open311::GetServiceRequests->new( verbose => $verbose );
+
+$reports->fetch;