FlorianO / clj-offeneskoeln

Simple wrapper for the api of www.offeneskoeln.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#clj-offeneskoeln

A clojure library for the Offenes Köln api.

Installation

clj-offeneskoeln will soon be available from Clojars:

[clj-offeneskoeln "0.1.0"]

Usage

Everything is available in clj-offeneskoeln.core namespace.

If you want to use it from the repl:

(use 'clj-offeneskoeln.core)

If you want to use it in a project:

(ns your-fancy.app
    (:require [clj-offeneskoeln :as k]))

A request always looks like this:

(k/offenes-koeln req-type req-data)

where req-type is a given map from:

  • get-documents
  • search-documents
  • get-locations
  • get-streets
  • get-session
  • get-terms

and req-data is a map with your values.

Valid parameter for the request-data

get-documents

  • :reference - single or comma-separated document references
  • :output - single or comma-separated output type (attachments, thumbnails, consultations, facets)
  • :sort-order - asc, desc date asc or date desc

search-documents

  • :query - A query string. Supports Lucene query syntax
  • :filter-query - Filter based on a document property. For example "type:Antrag". Lucene query syntax.
    • title
    • term
    • type
    • person
    • attachment
    • session
    • comittee
    • street
  • :sort-order -
  • :output - single or comma-separated output type (attachments, thumbnails, consultations, facets)
  • :maximum-results - Number of maximum returned documents
  • :result-offset - How many documents to skip.
  • :date-filter - Filter by date.

get-locations

get-streets

get-session

get-terms

Examples from the api documentation

Get documents

(k/offenes-koeln get-documents {:reference "2961/2011"})
(k/offenes-koeln get-documents {:reference "2961/2011" :output "attachments"})
(k/offenes-koeln get-documents {:reference "2961/2011" :output "attachments,thumbnails"})

Search documents

(k/offenes-koeln search-documents {:query "Bycicle"})
(k/offenes-koeln search-documents {:filter-query "type:Antrag"})

Get location data for a street

Get all Details for "Roncalliplatz"

(k/offenes-koeln get-locations {:street "Roncalliplatz"})

Get the average location for "Marzellenstraße"

(k/offenes-koeln get-locations {:street "Marzellenstraße" :output "averages"})

Get the nodes for "Aachener Straße"

(k/offenes-koeln get-locations {:street "Aachener Straße" :output "nodes"})

Find streets for a given location

Get all streets around 50,959/6,946.

(k/offenes-koeln get-street {:latitude "50.959" :longitude "6.946"})

Get and set session data

(k/offenes-koeln get-session {})

Get document terms

(k/offenes-koeln get-terms {})

Continuous Integration

Continuous Integration status

License

Copyright © 2013 Florian Over

Distributed under the Eclipse Public License, the same as Clojure.

About

Simple wrapper for the api of www.offeneskoeln.de


Languages

Language:Clojure 100.0%