diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-23 09:08:12 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-23 09:08:12 +0100 |
commit | 55d0afab34953d266824448d279d72787bfd6e07 (patch) | |
tree | 9640df781c74088cb512c0d1ca4f9c8ee5fd950b /web/json.cgi | |
parent | c62870edf51e1bfe04ad11256bd7ba8b5a4ee5d5 (diff) | |
parent | 8fbb9539e8ada7faf6c54c40bda7d059bdfd0c12 (diff) |
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 'web/json.cgi')
-rwxr-xr-x | web/json.cgi | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/web/json.cgi b/web/json.cgi index 512750988..70ae2a76f 100755 --- a/web/json.cgi +++ b/web/json.cgi @@ -8,28 +8,28 @@ # # $Id: json.cgi,v 1.4 2010-01-20 11:31:26 matthew Exp $ -use strict; -use Error qw(:try); -use JSON; -use Standard; - -sub main { - my $q = shift; - my $problems; - my $type = $q->param('type') || ''; - my $start_date = $q->param('start_date') || ''; - my $end_date = $q->param('end_date') || ''; - if ($start_date !~ /^\d{4}-\d\d-\d\d$/ || $end_date !~ /^\d{4}-\d\d-\d\d$/) { - $problems = { error => 'Invalid dates supplied' }; - } elsif ($type eq 'new_problems') { - $problems = Problems::created_in_interval($start_date, $end_date); - } elsif ($type eq 'fixed_problems') { - $problems = Problems::fixed_in_interval($start_date, $end_date); - } - print $q->header( -type => 'application/json; charset=utf-8' ); - print JSON::to_json($problems); -} - - -Page::do_fastcgi(\&main); - +# use strict; +# use Error qw(:try); +# use JSON; +# use Standard; +# +# sub main { +# my $q = shift; +# my $problems; +# my $type = $q->param('type') || ''; +# my $start_date = $q->param('start_date') || ''; +# my $end_date = $q->param('end_date') || ''; +# if ($start_date !~ /^\d{4}-\d\d-\d\d$/ || $end_date !~ /^\d{4}-\d\d-\d\d$/) { +# $problems = { error => 'Invalid dates supplied' }; +# } elsif ($type eq 'new_problems') { +# $problems = Problems::created_in_interval($start_date, $end_date); +# } elsif ($type eq 'fixed_problems') { +# $problems = Problems::fixed_in_interval($start_date, $end_date); +# } +# print $q->header( -type => 'application/json; charset=utf-8' ); +# print JSON::to_json($problems); +# } +# +# +# Page::do_fastcgi(\&main); +# |