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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50397ac505fc52609f22907592d0591d20c1313f
4
- data.tar.gz: c0fd91e76500c30b15ace8f53f8ba1953f64d978
3
+ metadata.gz: d5e8976161a3ed6f9ac10917afc1597464eea68d
4
+ data.tar.gz: bc50afcdb1e971a347fd71229557ef4e5210eaa2
5
5
  SHA512:
6
- metadata.gz: a318b79fd5ff9565adc2b4f8520875329bf1fe065e13fe657f1c3872c9c2473c0910e6ed3f612aebeaa6c60f5198a1f7222c29689af5eb13778681655a3bd8a0
7
- data.tar.gz: 907870d020c4f3979eea3153069847e18775edc80f898b4a46bf566a6faa86c0a5b82b0142c8948dc582b6d475974ddb9f81daf748fc1da283a7f6fefbcd1167
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.4
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
@@ -5,9 +5,9 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "robut-weather"
8
- s.version = "0.1.4"
8
+ s.version = "1.0.0.pre1"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
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.1.4
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: '0'
163
+ version: 1.3.1
164
164
  requirements: []
165
165
  rubyforge_project:
166
166
  rubygems_version: 2.0.3