https://github.com/3zcurdia/waqi
Air Quality Open Data Platform api wrapper
https://github.com/3zcurdia/waqi
air api open-data pollution ruby wrapper
Last synced: about 1 year ago
JSON representation
Air Quality Open Data Platform api wrapper
- Host: GitHub
- URL: https://github.com/3zcurdia/waqi
- Owner: 3zcurdia
- License: mit
- Created: 2017-02-15T03:38:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T14:24:55.000Z (about 6 years ago)
- Last Synced: 2025-03-26T04:33:49.396Z (about 1 year ago)
- Topics: air, api, open-data, pollution, ruby, wrapper
- Language: Ruby
- Homepage:
- Size: 40 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Waqi
[](https://travis-ci.org/3zcurdia/waqi) [](https://lima.codeclimate.com/github/3zcurdia/waqi)
[Air Quality Open Data Platform](http://aqicn.org/api/) ruby wrapper
## Installation
```ruby
gem 'waqi'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install waqi
## Usage
Initialize the client
```ruby
require 'waqi'
client = Waqi::Client.new(token: 'secret token')
```
City feed, it returns StationData
```ruby
client.city_feed('shanghai')
```
Station feed, it returns StationData
```ruby
client.station_feed(400)
```
Geolocalized feed, it returns StationData
```ruby
client.geo_feed(37.774929, -122.419416)
```
Local feed, it returns the nearest StationData
```ruby
client.local_feed
```
Feed map within bounds, it returns an array of StationPin
```ruby
client.map_stations(39.379436, 116.091230, 40.235643, 116.784382)
```
Search by keyword, it returns an array of StationData
```ruby
client.search('bangalore')
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/3zcurdia/waqi