aboutsummaryrefslogtreecommitdiffstats
path: root/bin/open311-populate-service-list
blob: be1ace3b926d48432f335509febe9fbb57b9c169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env perl

use strict;
use warnings;
use FixMyStreet::App;
use Open311::PopulateServiceList;
use Getopt::Long::Descriptive;

my ($opt, $usage) = describe_options(
    '%c %o',
    ['verbose|v',  "print out all services as they are found"],
    ['warn|w',     "output warnings about any issues"],
    ['help',       "print usage message and exit" ],
);
print($usage->text), exit if $opt->help;

my $bodies = FixMyStreet::App->model('DB::Body')->search( {
    id => { '!=', 2237 }, # XXX Until Oxfordshire does do so
    send_method => 'Open311'
} );
my $verbose = 0;
$verbose = 1 if $opt->warn;
$verbose = 2 if $opt->verbose;
my $p = Open311::PopulateServiceList->new( bodies => $bodies, verbose => $verbose );

$p->process_bodies;