Project

zwemwater

0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem to get swimming water status from recognized Dutch swimming spots.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.11.0
~> 10.1.0
~> 1.13.0

Runtime

~> 0.11.0
 Project Readme

Zwemwater

Build Status Coverage Status Gem Version

Zwemwater provides a simple API to get the latest known status from recognized Dutch swimming spots. It pulls data from the Dutch zwemwater.nl website.

Usage

You can use zwemwater out of the box.

require 'zwemwater'

zwemwater = Zwemwater.new('Lytse Wielen')
puts zwemwater.status     # { "code" => :goed }

When a swimming spot has an error code other than :goed, the date of measurement is also provided.

zwemwater = Zwemwater.new('Blauwe Meer Dinxperlo')
puts zwemwater.status     # { "code" => :negatief_zwemadvies, "date" => #<Date: 2013-07-05> }

The zwemwater.nl website provides more information on swimming spots than just the status. This data is also fetched and can be accessed trough the #data method of a zwemwater instance.

zwemwater = Zwemwater.new('Lytse Wielen')
puts zwemwater.data     # { "properties" => { "objectType" => "zwemplek", "id" => 1686, "status" => { "code" => "goed" }, "boundingBox" => { "minx" => 187255.29648096, "miny" => 580892.53598798, "maxx" => 187426.65648096, "maxy" => 580965.19598798}, "naam" => "Lytse Wielen", "zwemwaterlocatieId" => 965}, "geometry" => { "type" => "Point", "coordinates" => [187340.3393170484, 580935.4267625385]}, "type" => "Feature" }

Listing possible queries

A list of all possible queries (locations) can be accessed trough Zwemwater::Response#locations after instantiation or after a manual fetch of statuses.

Zwemwater::Service.get_statuses
puts Zwemwater::Response.locations     # ["Aakvlaai, Badstrand", "Abbertstrand", "Agnietenplas Oost", ..]

TODO

  • Better handling of raw zwemwater.nl data

Supported Ruby Versions

Zwemwater is tested under 1.9.2, 1.9.3, 2.0.0, JRuby 1.7.2 (1.9 mode), and Rubinius 2.0.0 (1.9 mode).

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request