diff options
author | Marius Halden <marius.h@lden.org> | 2021-10-07 13:32:40 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2021-10-07 13:32:40 +0200 |
commit | 09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch) | |
tree | 7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /bin/open311-update-reports | |
parent | 585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff) | |
parent | cea89fb87a96943708a1db0f646492fbfaaf000f (diff) |
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 'bin/open311-update-reports')
-rwxr-xr-x | bin/open311-update-reports | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/bin/open311-update-reports b/bin/open311-update-reports index 2d384b813..b9b4d594d 100755 --- a/bin/open311-update-reports +++ b/bin/open311-update-reports @@ -8,6 +8,7 @@ use strict; use warnings; +use v5.14; BEGIN { use File::Basename qw(dirname); @@ -16,21 +17,21 @@ BEGIN { require "$d/../setenv.pl"; } +use Getopt::Long::Descriptive; use Open311::GetUpdates; -use FixMyStreet; -use FixMyStreet::DB; -# FIXME - make this configurable and/or better -my $system_user = FixMyStreet::DB->resultset('User')->find_or_create( - { - email => FixMyStreet->config('CONTACT_EMAIL'), - name => 'System User', - } +my ($opts, $usage) = describe_options( + '%c %o', + ['body|b:s', 'body name to only fetch this body' ], + ['verbose|v', 'more verbose output'], + ['help|h', "print usage message and exit" ], ); +$usage->die if $opts->help; -my $body_list = FixMyStreet::DB->resultset('Body'); +my %params = ( + verbose => $opts->verbose, + body => $opts->body, +); -my $update = Open311::GetUpdates->new( - body_list => $body_list, - system_user => $system_user -)->get_updates; +my $updates = Open311::GetUpdates->new(%params); +$updates->fetch; |