Skip to content

ryanbriones/open311-clj

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

open311-clj

A clojure library for connecting to HTTP APIs that implement the Open311 GeoReport v2 specification.

Usage

; http://wiki.open311.org/GeoReport_v2#GET_Service_List
(def random-service (rand-nth
  (open311-clj.core/services
    {:endpoint "http://test311api.cityofchicago.org/open311/v2"})))

; http://wiki.open311.org/GeoReport_v2#GET_Service_Definition
(open311-clj.core/service-definition (:service_code random-service)
  {:endpoint "http://test311api.cityofchicago.org/open311/v2"})

; http://wiki.open311.org/GeoReport_v2#GET_Service_Requests
(def random-request (rand-nth
  (open311-clj.core/requests
    {:endpoint "http://test311api.cityofchicago.org/open311/v2"})))

; http://wiki.open311.org/GeoReport_v2#GET_Service_Requests with params
; see specification for "Optional Arguments" that can be included
; e.g. "all open requests"
(def random-open-request (rand-nth
  (open311-clj.core/requests
    {:endpoint "http://test311api.cityofchicago.org/open311/v2"
     :params {:status "open"} })))

; http://wiki.open311.org/GeoReport_v2#GET_Service_Request
(open311-clj.core/request (:service_request_id random-request)
  {:endpoint "http://test311api.cityofchicago.org/open311/v2"})

TODO

  • functions for POSTing requests retrieving service_request_ids from tokens
  • TESTS!!! (My first clojure library, so have mercy)
  • docstrings
  • clojars (for ease of use)
  • (requests-lazy) - lazy sequence to "infinitely" iterate over requests pages

License

MIT License. See LICENSE

About

A clojure library for connecting to HTTP APIs that implement the Open311 GeoReport v2 specification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published