BetaNYC / citygram-services-nyc

Web content transformation proxies for open data API's
https://citygram-services-nyc.herokuapp.com/
4 stars 6 forks source link

Derelict Bicycle #38

Open rayrshah opened 8 years ago

rayrshah commented 8 years ago

User Story: As a neighbor, I would like to identify derelict and abandoned bikes in my neighborhood

Identify Data:

Complaint Type Descriptor
Derelict Bicycle %Derelict Bicycle%
Bike Rack Condition Chained Bike
Illegal Tree Damage Bicycle Chained%

Ruby / SQL

query = {
  '$limit' => 1000,
  '$order' => 'created_date DESC',
  '$where' => <<-WHERE.oneline
    created_date >= '#{SpyGlass::Utils.last_week_floating_timestamp}' AND
    longitude IS NOT NULL AND
    latitude IS NOT NULL AND
    (
      descriptor LIKE '%Derelict Bicycle%' OR
      descriptor LIKE 'Chained Bike' OR
      descriptor LIKE 'Bicycle Chained%'
    ) AND
    unique_key IS NOT NULL
  WHERE
}

**Issue Icon: noun_44321_cc