Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 months 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 (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T14:24:55.000Z (over 4 years ago)
- Last Synced: 2024-10-10T16:17:09.267Z (4 months ago)
- Topics: air, api, open-data, pollution, ruby, wrapper
- Language: Ruby
- Homepage:
- Size: 40 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Waqi
[![Build Status](https://travis-ci.org/3zcurdia/waqi.svg?branch=master)](https://travis-ci.org/3zcurdia/waqi) [![Code Climate](https://lima.codeclimate.com/github/3zcurdia/waqi/badges/gpa.svg)](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