open_weather_map_api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +96 -0
- data/open_weather_map_api.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e50d518020772b84d8bfc582d2f04353ac5b896658dc79fa911f33d481e33a6
|
4
|
+
data.tar.gz: 336d13cc7c6cfbae9403a5d2368477173a13f426e2e493b6209f5a773001dbfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b2d702919711c607b9117812dd854c5c59621c302d3f49de4962c3ac914e9248870845e6477d6d81b189eb0421f501bb9b788880069f4e487b5145b39dbac78
|
7
|
+
data.tar.gz: 2b45bee777294ae808a2694abc9b371e34b64deef1329a844b458d686e93c034fc0353537efd548d654773c59e96078872d7ce9ec75c29d0aeb98ef949b4e5d3
|
data/README.md
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# OpenWeatherMapAPI - Ruby API Client
|
2
|
+
|
3
|
+
Get Weather and Forecast for the city you want easily.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'open_weather_map_api'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage Examples
|
20
|
+
|
21
|
+
**Get weather by city**
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
OpenWeatherMapApi.get_weather(q: 'florianopolis', appid: <APPID>)
|
25
|
+
```
|
26
|
+
|
27
|
+
**Get weather by latitude an longitude**
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
OpenWeatherMapApi.get_weather(lat: '51.5085', lon: '-0.1257', appid: <APPID>)
|
31
|
+
```
|
32
|
+
|
33
|
+
**Get forecast by city**
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
OpenWeatherMapApi.get_forecast(q: 'florianopolis', appid: <APPID>)
|
37
|
+
```
|
38
|
+
|
39
|
+
**Get forecast by latitude an longitude**
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
OpenWeatherMapApi.get_forecast(lat: '51.5085', lon: '-0.1257', appid: <APPID>)
|
43
|
+
```
|
44
|
+
|
45
|
+
**Get weather in Celsius**
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
OpenWeatherMapApi.get_weather(q: 'florianopolis', units: 'metric', appid: <APPID>)
|
49
|
+
```
|
50
|
+
|
51
|
+
**Get weather in Fahrenheit**
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
OpenWeatherMapApi.get_weather(q: 'florianopolis', units: 'imperial', appid: <APPID>)
|
55
|
+
```
|
56
|
+
|
57
|
+
**Get weather response in Portuguese**
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
OpenWeatherMapApi.get_weather(q: 'florianopolis', lang: 'pt_br', appid: <APPID>)
|
61
|
+
```
|
62
|
+
|
63
|
+
**Get weather response format in xml**
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
OpenWeatherMapApi.get_weather(q: 'florianopolis', mode: 'xml', appid: <APPID>)
|
67
|
+
```
|
68
|
+
|
69
|
+
**Get weather response format in html**
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
OpenWeatherMapApi.get_weather(q: 'florianopolis', mode: 'html', appid: <APPID>)
|
73
|
+
```
|
74
|
+
|
75
|
+
## Props
|
76
|
+
|
77
|
+
**Weather**
|
78
|
+
|
79
|
+
| Prop | Type | Default | Note |
|
80
|
+
| ---------------------- | ------------------------------ | ---------- | ------------------------------------------------ |
|
81
|
+
| `lat, lon` | `string` | `required` | Geographical coordinates (latitude, longitude) |
|
82
|
+
| `appid` | `string` | `required` | Your unique API key. [Learn more](https://home.openweathermap.org/api_keys) |
|
83
|
+
| `mode` | `json, xml, html` | `json` | Response format |
|
84
|
+
| `units` | `standard, metric, imperial` | `standard` | Units of measurement: standard: `Kelvin`, metric: `Celsius`, imperial: `Fahrenheit` |
|
85
|
+
| `lang` | `string` | `en` | You can use this parameter to get the output in your language. [Learn more](https://openweathermap.org/current#multi) |
|
86
|
+
|
87
|
+
**Forecast**
|
88
|
+
|
89
|
+
| Prop | Type | Default | Note |
|
90
|
+
| ---------------------- | ------------------------------ | ---------- | ------------------------------------------------ |
|
91
|
+
| `lat, lon` | `string` | `required` | Geographical coordinates (latitude, longitude) |
|
92
|
+
| `appid` | `string` | `required` | Your unique API key. [Learn more](https://home.openweathermap.org/api_keys) |
|
93
|
+
| `mode` | `json, xml, html` | `json` | Response format |
|
94
|
+
| `units` | `standard, metric, imperial` | `standard` | Units of measurement: standard: `Kelvin`, metric: `Celsius`, imperial: `Fahrenheit` |
|
95
|
+
| `lang` | `string` | `en` | You can use this parameter to get the output in your language. [Learn more](https://openweathermap.org/current#multi) |
|
96
|
+
| `cnt` | `string` | `optional` | A number of timestamps, which will be returned in the API response |
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'open_weather_map_api'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.2'
|
4
4
|
s.summary = "Implementation of OpenWeatherMap API"
|
5
5
|
s.description = "Get Weather and Forecast for the city you want easily"
|
6
6
|
s.authors = ["Wellington Gomes Graciani"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_weather_map_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wellington Gomes Graciani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -46,6 +46,7 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- ".gitignore"
|
48
48
|
- Gemfile
|
49
|
+
- README.md
|
49
50
|
- lib/open_weather_map_api.rb
|
50
51
|
- open_weather_map_api.gemspec
|
51
52
|
- spec/open_weather_map_api_spec.rb
|