weather_forecast 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/weather_forecast.rb +30 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 554849636a4bdb33ae4fc55ec5e51e56ba67e477
|
4
|
+
data.tar.gz: 8fd6d1f41f01e75379d5169c709e90e97417951a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fe11c2b9efc2eabc01540be14759906ce6d14cfa4b124ab39f1f6b13228d69d18d9438b6383f6d080a38d6458096064d30338580ac84b88ba638a7aa3323c391
|
7
|
+
data.tar.gz: 64b2b8991ad8ed7ac0ca3072030ed41d934b9ba37645cf0b75eb5a8aa91a03e1a6c914a231cbc40798e50aa412691ee11d8d0c1a5db151ddabc79e902ec1c828
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "httparty"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
class Weather_Forecast
|
5
|
+
|
6
|
+
API_KEY = "e046860d9eefc1d12485b5cea5a7c262"
|
7
|
+
@test_lat = -41.8819
|
8
|
+
@test_long = 87.65
|
9
|
+
|
10
|
+
def self.hi
|
11
|
+
puts "Hello world!"
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.get_forecast(latitude, longitude)
|
15
|
+
url = "https://api.forecast.io/forecast/#{API_KEY}/#{latitude},#{longitude}"
|
16
|
+
puts url
|
17
|
+
|
18
|
+
response = HTTParty.get(url)
|
19
|
+
|
20
|
+
json = JSON.parse(response.body)
|
21
|
+
|
22
|
+
puts json
|
23
|
+
|
24
|
+
return json
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.get_test_json
|
28
|
+
self.get_forecast(:test_lat, :test_long)
|
29
|
+
end
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: weather_forecast
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jim Challenger
|
8
|
+
- Justin White
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-08-11 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: A gem that uses the forecast.io API in order to get accurate weather
|
15
|
+
reports
|
16
|
+
email: jim.challenger1@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/weather_forecast.rb
|
22
|
+
homepage: http://rubygems.org/gems/weather_forecast
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.0.3
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Get accurate weather readings
|
46
|
+
test_files: []
|