#!/usr/bin/env perl # update-all-reports: # Generate the data for the /reports page # # Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org use strict; use warnings; BEGIN { use File::Basename qw(dirname); use File::Spec; my $d = dirname(File::Spec->rel2abs($0)); require "$d/../setenv.pl"; } use FixMyStreet::Script::UpdateAllReports; use Getopt::Long::Descriptive; my ($opt, $usage) = describe_options( '%c %o', [ 'table', "Output JSON for old table-style page." ], [ 'areas', "Include area IDs in output JSON." ], [ 'help', "print usage message and exit", { shortcircuit => 1 } ], ); print($usage->text), exit if $opt->help; if ($opt->table) { FixMyStreet::Script::UpdateAllReports::generate($opt->areas); } else { FixMyStreet::Script::UpdateAllReports::generate_dashboard(); }