https://github.com/jdennes/buienalarm
Super-simple library to scrape Buienalarm.nl for projected rainfall.
https://github.com/jdennes/buienalarm
dutch netherlands rainfall ruby weather
Last synced: 3 months ago
JSON representation
Super-simple library to scrape Buienalarm.nl for projected rainfall.
- Host: GitHub
- URL: https://github.com/jdennes/buienalarm
- Owner: jdennes
- License: mit
- Created: 2016-04-24T14:48:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-12T18:54:47.000Z (about 9 years ago)
- Last Synced: 2026-03-27T23:42:15.156Z (3 months ago)
- Topics: dutch, netherlands, rainfall, ruby, weather
- Language: Ruby
- Homepage:
- Size: 34.2 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# buienalarm
This is a super-simple library to scrape [Buienalarm.nl](http://www.buienalarm.nl/) for projected rainfall.
Currently just provides the following interface for scraping projected rainfall for a location in the next two hours:
```rb
>> result = Buienalarm::Scraper.scrape("rotterdam")
=> {:location=>"Rotterdam", :rainfall=>[{:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}, {:time=>#, :rainfall=>0.0003924189758484536, :level=>"none"}]}
```
Also provides `script/scrape` to test this from the command line:
```
$ script/scrape rotterdam
===> Scraping Buienalarm.nl...
Projected rainfall for the next two hours in Rotterdam:
20:00 - 1.54mm/hour (heavy)
20:05 - 1.91mm/hour (heavy)
20:10 - 1.54mm/hour (heavy)
20:15 - 2.74mm/hour (heavy)
20:20 - 3.92mm/hour (heavy)
20:25 - 5.23mm/hour (heavy)
20:30 - 3.65mm/hour (heavy)
20:35 - 2.37mm/hour (heavy)
20:40 - 0.87mm/hour (moderate)
20:45 - 1.33mm/hour (heavy)
20:50 - 0.21mm/hour (moderate)
20:55 - 0.03mm/hour (light)
21:00 - 0.00mm/hour (none)
21:05 - 0.00mm/hour (none)
21:10 - 0.00mm/hour (none)
21:15 - 0.00mm/hour (none)
21:20 - 0.02mm/hour (light)
21:25 - 0.00mm/hour (none)
21:30 - 0.00mm/hour (none)
21:35 - 0.00mm/hour (none)
21:40 - 0.09mm/hour (light)
21:45 - 0.09mm/hour (light)
21:50 - 0.18mm/hour (moderate)
21:55 - 1.07mm/hour (heavy)
22:00 - 0.65mm/hour (moderate)
```
To work on this locally:
```
script/bootstrap
```
To run the tests:
```
script/test [test/test_file.rb]
```