robut-weather 0.1.4 → 1.0.0.pre1
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 +4 -4
- data/README.rdoc +3 -0
- data/VERSION +1 -1
- data/lib/robut-weather.rb +27 -1
- data/robut-weather.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5e8976161a3ed6f9ac10917afc1597464eea68d
|
4
|
+
data.tar.gz: bc50afcdb1e971a347fd71229557ef4e5210eaa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9be4bd2392cccc1804cf639537fce321299114978de2d1c5aedb9870851d6a190f6bad3103ffa207b941e61c722a616c5d747f3794e00dd02c58b6d2f4363771
|
7
|
+
data.tar.gz: 14593edcd34bfc29d5b16134a1b3abcc4fab1159d46fa6990f8a75413690e2d1e54f5209d5d69f15920cdb359b3b26ea0c6b4adc3bebf8e28d41c2f6bcc1754b
|
data/README.rdoc
CHANGED
@@ -20,6 +20,9 @@ Your Chatfile will need to have the Weather plugin loaded.
|
|
20
20
|
|
21
21
|
== Changelog
|
22
22
|
|
23
|
+
[v1.0.0.pre1 released 9/28/2014]
|
24
|
+
Added initial basic support for the radar command
|
25
|
+
|
23
26
|
[v0.1.4 released 9/28/2014]
|
24
27
|
Command now requires you to specify the bot's name as an @mention
|
25
28
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0.pre1
|
data/lib/robut-weather.rb
CHANGED
@@ -14,7 +14,9 @@ class Robut::Plugin::Weather
|
|
14
14
|
def usage
|
15
15
|
[
|
16
16
|
"#{at_nick} weather - returns the current conditions in the default location",
|
17
|
-
"#{at_nick} weather <location> - returns the current conditions for <location>"
|
17
|
+
"#{at_nick} weather <location> - returns the current conditions for <location>",
|
18
|
+
"#{at_nick} radar - returns the radar for the default location",
|
19
|
+
"#{at_nick} radar <location> - returns the radar for <location>"
|
18
20
|
]
|
19
21
|
end
|
20
22
|
|
@@ -22,6 +24,23 @@ class Robut::Plugin::Weather
|
|
22
24
|
if sent_to_me?(message)
|
23
25
|
words = words(message)
|
24
26
|
|
27
|
+
i = words.index("radar")
|
28
|
+
unless i.nil?
|
29
|
+
l = location(words(message)[i + 1])
|
30
|
+
if l.nil?
|
31
|
+
error_output "I don't have a default location!"
|
32
|
+
return
|
33
|
+
end
|
34
|
+
|
35
|
+
begin
|
36
|
+
o = radar(l)
|
37
|
+
reply o unless o.nil? || o == ""
|
38
|
+
rescue Exception => msg
|
39
|
+
puts msg
|
40
|
+
error_output(msg)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
25
44
|
i = words.index("weather")
|
26
45
|
# ignore messages that don't have "weather" in them
|
27
46
|
return if i.nil?
|
@@ -77,4 +96,11 @@ class Robut::Plugin::Weather
|
|
77
96
|
current_conditions = "Weather for #{w['display_location']['full']}: #{w['weather']}, Current Temperature #{w['temperature_string']}, Wind #{w['wind_string']}. Full forecast: #{w['forecast_url']}"
|
78
97
|
current_conditions
|
79
98
|
end
|
99
|
+
|
100
|
+
# Get radar image
|
101
|
+
def radar(l)
|
102
|
+
|
103
|
+
w_api = Wunderground.new(self.class.api_key)
|
104
|
+
return "#{w_api.base_api_url}animatedradar/q/#{l}.gif?num=6&delay=50&interval=30"
|
105
|
+
end
|
80
106
|
end
|
data/robut-weather.gemspec
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "robut-weather"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "1.0.0.pre1"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Richard Lynskey"]
|
12
12
|
s.date = "2014-09-28"
|
13
13
|
s.description = "A Wunderground based weather plugin for robut"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: robut-weather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Lynskey
|
@@ -158,9 +158,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- - '
|
161
|
+
- - '>'
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
163
|
+
version: 1.3.1
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
166
|
rubygems_version: 2.0.3
|