weather_in_poland 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/weather_in_poland/version.rb +1 -1
- data/lib/weather_in_poland.rb +4 -6
- metadata +4 -4
data/lib/weather_in_poland.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
class WeatherInPoland
|
3
2
|
attr_reader :city
|
4
3
|
attr_reader :code
|
5
4
|
attr_reader :image
|
6
5
|
attr_reader :thumb
|
7
6
|
|
8
|
-
def
|
7
|
+
def find_city(name='Gdynia')
|
9
8
|
agent = Mechanize.new
|
10
9
|
page = agent.get("http://weather.yahoo.com/poland/")
|
11
10
|
form = page.form('pform')
|
@@ -23,13 +22,13 @@ module WeatherInPoland
|
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
26
|
-
def
|
25
|
+
def get_weather(code)
|
27
26
|
client = YahooWeather::Client.new
|
28
27
|
response = client.lookup_by_woeid(code, YahooWeather::Units::CELSIUS)
|
29
28
|
return response
|
30
29
|
end
|
31
30
|
|
32
|
-
def
|
31
|
+
def get_image(dane)
|
33
32
|
sun_rise = dane.astronomy.sunrise
|
34
33
|
sun_set = dane.astronomy.sunset
|
35
34
|
|
@@ -42,5 +41,4 @@ module WeatherInPoland
|
|
42
41
|
@thumb = "http://l.yimg.com/a/i/us/nws/weather/gr/#{dane.condition.code.to_s+time_of_day}s.png"
|
43
42
|
@image = "http://l.yimg.com/a/i/us/nws/weather/gr/#{dane.condition.code.to_s+time_of_day}.png"
|
44
43
|
end
|
45
|
-
|
46
44
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weather_in_poland
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Oskar Szrajer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-10 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|