aboutsummaryrefslogtreecommitdiffstats
path: root/web/json.cgi
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-10 14:56:00 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-10 14:56:00 +0100
commit391ca1c469d93bb2c4798cc15e56fc495b5e80dd (patch)
tree6bc90fae589de824095e668fbf510ef259935729 /web/json.cgi
parent7c96f8ec61d6eddc211f3f0e71cdb276c6a5f773 (diff)
parent860383f0de3287b0666d64a3ffff3db3a0f087ae (diff)
Merge branch 'migrate_to_catalyst' into reportemptyhomes
Diffstat (limited to 'web/json.cgi')
-rwxr-xr-xweb/json.cgi35
1 files changed, 0 insertions, 35 deletions
diff --git a/web/json.cgi b/web/json.cgi
deleted file mode 100755
index 512750988..000000000
--- a/web/json.cgi
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/perl -w -I../perllib
-
-# json.cgi:
-# A small JSON API for FixMyStreet
-#
-# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
-# Email: louise@mysociety.org. WWW: http://www.mysociety.org
-#
-# $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);
-