smartchicago / chicagoworksforyou

A citywide dashboard with ward-by-ward views of service delivery in Chicago. Includes complete API. Built using Chicago Open311 data.
http://www.chicagoworksforyou.com
MIT License
17 stars 6 forks source link

Add historic highs endpoint #144

Closed cgansen closed 11 years ago

cgansen commented 11 years ago

This adds a new endpoint to return the n days with the highest number of SR opened.

For example:

$ curl "http://localhost:5000/wards/32/historic_highs.json?service_code=4fd3b167e750846744000005&count=10&include_today=true"
[
  {
    "2013-07-25": 0
  },
  {
    "2010-10-27": 94
  },
  {
    "2008-07-01": 75
  },
  {
    "2010-10-25": 70
  },
  {
    "2008-05-16": 68
  },
  {
    "2010-10-14": 65
  },
  {
    "2008-03-20": 64
  },
  {
    "2009-01-16": 60
  },
  {
    "2008-07-30": 60
  },
  {
    "2008-05-27": 60
  },
  {
    "2008-02-18": 60
  }
]

The response is a sorted array of maps. The optional include_today parameter will, if set to '1' or 'true', include the current day's count of SR opened.

cgansen commented 11 years ago

Closes #130