zetabot 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +35 -34
- data/lib/Zeta/plugins/seen.rb +0 -1
- data/lib/Zeta/plugins/weather.rb +16 -106
- data/lib/Zeta/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2429ddf380f1ac41654c012e259c544c9a0ff0e590f17f913e075942601d18
|
4
|
+
data.tar.gz: 648688cd373041736a394c91639f68ad01440befabbbbf4a74d268bb374021a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f7c7e290f02c30d77c662418ee589d2f5269bcdd1c3bbcda80a7416b1c96e014bf7b24c815d0db4bddf4c0ebc9289e6173f653603857925c5ba5c05d98b37c6
|
7
|
+
data.tar.gz: ec190062500dca097dc17477edd7323e5b5ab33fa33de30492c15a92a420e3c2d58275d05f6899f63f1bfcf433391ffe77b37d04bc37de793c6fa8025049195f
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zetabot (1.0
|
4
|
+
zetabot (1.1.0)
|
5
5
|
actionview
|
6
6
|
chronic
|
7
7
|
chronic_duration
|
@@ -42,18 +42,18 @@ GEM
|
|
42
42
|
remote: https://rubygems.org/
|
43
43
|
specs:
|
44
44
|
Ascii85 (1.0.3)
|
45
|
-
actionview (5.2.
|
46
|
-
activesupport (= 5.2.
|
45
|
+
actionview (5.2.2)
|
46
|
+
activesupport (= 5.2.2)
|
47
47
|
builder (~> 3.1)
|
48
48
|
erubi (~> 1.4)
|
49
49
|
rails-dom-testing (~> 2.0)
|
50
50
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
51
|
-
activesupport (5.2.
|
51
|
+
activesupport (5.2.2)
|
52
52
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
53
53
|
i18n (>= 0.7, < 2)
|
54
54
|
minitest (~> 5.1)
|
55
55
|
tzinfo (~> 1.1)
|
56
|
-
addressable (2.
|
56
|
+
addressable (2.6.0)
|
57
57
|
public_suffix (>= 2.0.2, < 4.0)
|
58
58
|
afm (0.2.2)
|
59
59
|
ansi (1.5.0)
|
@@ -72,17 +72,17 @@ GEM
|
|
72
72
|
cinch (~> 2.0)
|
73
73
|
cinch-toolbox (1.1.6)
|
74
74
|
nokogiri (~> 1.6)
|
75
|
-
clipboard (1.
|
75
|
+
clipboard (1.3.3)
|
76
76
|
code (0.9.2)
|
77
77
|
coderay (~> 1.1)
|
78
78
|
method_source (~> 0.9)
|
79
79
|
coderay (1.1.2)
|
80
|
-
concurrent-ruby (1.
|
80
|
+
concurrent-ruby (1.1.4)
|
81
81
|
connection_pool (2.2.2)
|
82
82
|
crack (0.4.3)
|
83
83
|
safe_yaml (~> 1.0.0)
|
84
84
|
crass (1.0.4)
|
85
|
-
daemons (1.
|
85
|
+
daemons (1.3.1)
|
86
86
|
debugging (1.1.1)
|
87
87
|
binding.repl (~> 3.0)
|
88
88
|
paint (>= 0.9, < 3.0)
|
@@ -90,7 +90,7 @@ GEM
|
|
90
90
|
thread_safe (~> 0.3, >= 0.3.1)
|
91
91
|
destructor (0.1.0)
|
92
92
|
diff-lcs (1.3)
|
93
|
-
discourse_api (0.
|
93
|
+
discourse_api (0.33.0)
|
94
94
|
faraday (~> 0.9)
|
95
95
|
faraday_middleware (~> 0.10)
|
96
96
|
rack (>= 1.6)
|
@@ -100,18 +100,18 @@ GEM
|
|
100
100
|
dronebl.rb (0.1.0.0)
|
101
101
|
httparty (~> 0.13)
|
102
102
|
nokogiri (~> 1.6)
|
103
|
-
erubi (1.
|
103
|
+
erubi (1.8.0)
|
104
104
|
every_day_irb (2.0.0)
|
105
105
|
cd (~> 1.0)
|
106
106
|
fancy_irb (1.1.0)
|
107
107
|
paint (>= 0.9, < 3.0)
|
108
108
|
unicode-display_width (~> 1.1)
|
109
|
-
faraday (0.
|
109
|
+
faraday (0.15.4)
|
110
110
|
multipart-post (>= 1.2, < 3)
|
111
|
-
faraday_middleware (0.
|
111
|
+
faraday_middleware (0.13.1)
|
112
112
|
faraday (>= 0.7.4, < 1.0)
|
113
|
-
ffi (1.
|
114
|
-
geocoder (1.5.
|
113
|
+
ffi (1.10.0)
|
114
|
+
geocoder (1.5.1)
|
115
115
|
gist (5.0.0)
|
116
116
|
github_api (0.18.2)
|
117
117
|
addressable (~> 2.4)
|
@@ -127,10 +127,11 @@ GEM
|
|
127
127
|
hirb (0.7.3)
|
128
128
|
http-cookie (1.0.3)
|
129
129
|
domain_name (~> 0.5)
|
130
|
-
httparty (0.16.
|
130
|
+
httparty (0.16.4)
|
131
|
+
mime-types (~> 3.0)
|
131
132
|
multi_xml (>= 0.5.2)
|
132
133
|
humanize-bytes (2.2.0)
|
133
|
-
i18n (1.
|
134
|
+
i18n (1.6.0)
|
134
135
|
concurrent-ruby (~> 1.0)
|
135
136
|
instance (0.2.0)
|
136
137
|
interactive_editor (0.0.11)
|
@@ -157,9 +158,9 @@ GEM
|
|
157
158
|
ruby_version (~> 1.0)
|
158
159
|
wirb (~> 2.0)
|
159
160
|
iso8601 (0.9.1)
|
160
|
-
jwt (1.
|
161
|
+
jwt (2.1.0)
|
161
162
|
liner (0.2.4)
|
162
|
-
loofah (2.2.
|
163
|
+
loofah (2.2.3)
|
163
164
|
crass (~> 1.0.2)
|
164
165
|
nokogiri (>= 1.5.9)
|
165
166
|
mechanize (2.7.6)
|
@@ -174,12 +175,12 @@ GEM
|
|
174
175
|
memoizable (0.4.2)
|
175
176
|
thread_safe (~> 0.3, >= 0.3.1)
|
176
177
|
method_locator (0.0.4)
|
177
|
-
method_source (0.9.
|
178
|
+
method_source (0.9.2)
|
178
179
|
methodfinder (2.2.1)
|
179
180
|
mime-types (3.2.2)
|
180
181
|
mime-types-data (~> 3.2015)
|
181
182
|
mime-types-data (3.2018.0812)
|
182
|
-
mini_portile2 (2.
|
183
|
+
mini_portile2 (2.4.0)
|
183
184
|
minitest (5.11.3)
|
184
185
|
mkfifo (0.1.1)
|
185
186
|
multi_json (1.13.1)
|
@@ -190,13 +191,13 @@ GEM
|
|
190
191
|
connection_pool (~> 2.2)
|
191
192
|
net_http_timeout_errors (0.3.3)
|
192
193
|
netrc (0.11.0)
|
193
|
-
nokogiri (1.
|
194
|
-
mini_portile2 (~> 2.
|
194
|
+
nokogiri (1.10.1)
|
195
|
+
mini_portile2 (~> 2.4.0)
|
195
196
|
ntlm-http (0.1.1)
|
196
197
|
numerizer (0.1.1)
|
197
|
-
oauth2 (1.4.
|
198
|
-
faraday (>= 0.8, < 0.
|
199
|
-
jwt (
|
198
|
+
oauth2 (1.4.1)
|
199
|
+
faraday (>= 0.8, < 0.16.0)
|
200
|
+
jwt (>= 1.0, < 3.0)
|
200
201
|
multi_json (~> 1.3)
|
201
202
|
multi_xml (~> 0.5)
|
202
203
|
rack (>= 1.2, < 3)
|
@@ -205,9 +206,9 @@ GEM
|
|
205
206
|
ruby-ll (~> 2.1)
|
206
207
|
ori (0.1.0)
|
207
208
|
os (1.0.0)
|
208
|
-
paint (2.0
|
209
|
+
paint (2.1.0)
|
209
210
|
parslet (1.8.2)
|
210
|
-
pdf-reader (2.
|
211
|
+
pdf-reader (2.2.0)
|
211
212
|
Ascii85 (~> 1.0.0)
|
212
213
|
afm (~> 0.2.1)
|
213
214
|
hashery (~> 2.0)
|
@@ -215,7 +216,7 @@ GEM
|
|
215
216
|
ttfunk
|
216
217
|
persist (1.0.0)
|
217
218
|
public_suffix (3.0.3)
|
218
|
-
rack (2.0.
|
219
|
+
rack (2.0.6)
|
219
220
|
rails-dom-testing (2.0.3)
|
220
221
|
activesupport (>= 4.2.0)
|
221
222
|
nokogiri (>= 1.6)
|
@@ -233,7 +234,7 @@ GEM
|
|
233
234
|
rspec-mocks (~> 3.8.0)
|
234
235
|
rspec-core (3.8.0)
|
235
236
|
rspec-support (~> 3.8.0)
|
236
|
-
rspec-expectations (3.8.
|
237
|
+
rspec-expectations (3.8.2)
|
237
238
|
diff-lcs (>= 1.2.0, < 2.0)
|
238
239
|
rspec-support (~> 3.8.0)
|
239
240
|
rspec-mocks (3.8.0)
|
@@ -247,14 +248,14 @@ GEM
|
|
247
248
|
ruby_engine (1.0.1)
|
248
249
|
ruby_info (1.0.1)
|
249
250
|
ruby_version (1.0.1)
|
250
|
-
safe_yaml (1.0.
|
251
|
+
safe_yaml (1.0.5)
|
251
252
|
signed_multiset (0.2.1)
|
252
253
|
spoon (0.0.6)
|
253
254
|
ffi
|
254
255
|
tag_formatter (0.0.3)
|
255
|
-
temple (0.8.
|
256
|
+
temple (0.8.1)
|
256
257
|
thread_safe (0.3.6)
|
257
|
-
tilt (2.0.
|
258
|
+
tilt (2.0.9)
|
258
259
|
time-lord (1.0.1)
|
259
260
|
ttfunk (1.5.1)
|
260
261
|
tzinfo (1.2.5)
|
@@ -262,7 +263,7 @@ GEM
|
|
262
263
|
unf (0.1.4)
|
263
264
|
unf_ext
|
264
265
|
unf_ext (0.0.7.5)
|
265
|
-
unicode-display_width (1.
|
266
|
+
unicode-display_width (1.5.0)
|
266
267
|
unitwise (2.2.0)
|
267
268
|
liner (~> 0.2)
|
268
269
|
memoizable (~> 0.4)
|
@@ -291,4 +292,4 @@ DEPENDENCIES
|
|
291
292
|
zetabot!
|
292
293
|
|
293
294
|
BUNDLED WITH
|
294
|
-
1.
|
295
|
+
1.17.2
|
data/lib/Zeta/plugins/seen.rb
CHANGED
@@ -6,7 +6,6 @@ module Plugins
|
|
6
6
|
def to_s
|
7
7
|
# "[#{time.asctime}] #{who} was seen in #{where} last saying #{what}"
|
8
8
|
time_ago = time_ago_in_words(Time.at(time))
|
9
|
-
# "[ \x1F#{where.to_s.upcase}\x0F ] \x0304#{who}\x0F: \"\x0303#{what[0..300]}\x0F\" \x02#{time_ago}\x0F ago"
|
10
9
|
if where.to_s.upcase == 'STAFF' || where.to_s.upcase == 'SERVICES'
|
11
10
|
return ''
|
12
11
|
end
|
data/lib/Zeta/plugins/weather.rb
CHANGED
@@ -39,17 +39,17 @@ module Plugins
|
|
39
39
|
# Lookup user from pstore
|
40
40
|
if !@store[msg.user.to_s].nil? && query.nil?
|
41
41
|
stored_location, stored_source = @store[msg.user.to_s].split('::')
|
42
|
-
stored_source = @api_src.include?(stored_source) ? stored_source : '
|
42
|
+
stored_source = @api_src.include?(stored_source) ? stored_source : 'darksky'
|
43
43
|
data = send("#{stored_source}_src", stored_location)
|
44
44
|
# location = geolookup(@store[msg.user.to_s])
|
45
45
|
# data = wunderground_src(stored_location, false)
|
46
46
|
elsif query.nil?
|
47
|
-
return msg.reply 'No location set. ?setw <location> :(
|
47
|
+
return msg.reply 'No location set. ?setw <location> :(darksky|noaa|apixu|owm)'
|
48
48
|
else
|
49
49
|
# data = wu_src(query, true)
|
50
50
|
src = query[/:\w+/].gsub(/:/, '') if query[/:\w+/]
|
51
51
|
query = query.gsub(/:\w+/, '').strip if query
|
52
|
-
true_src = @api_src.include?(src) ? src : '
|
52
|
+
true_src = @api_src.include?(src) ? src : 'darksky'
|
53
53
|
data = send("#{true_src}_src", query)
|
54
54
|
end
|
55
55
|
return msg.reply "No results found for #{query} with #{true_src} source." if data.nil?
|
@@ -64,7 +64,7 @@ module Plugins
|
|
64
64
|
query = query.gsub(/:\w+/, '').strip if query
|
65
65
|
|
66
66
|
# Sanity Check
|
67
|
-
true_src = @api_src.include?(src) ? src : '
|
67
|
+
true_src = @api_src.include?(src) ? src : 'darksky'
|
68
68
|
data = send("#{true_src}_src", query)
|
69
69
|
|
70
70
|
# Error
|
@@ -76,106 +76,13 @@ module Plugins
|
|
76
76
|
msg.reply "Your location is now set to #{data.ac.name}, #{data.ac.c}!"
|
77
77
|
end
|
78
78
|
|
79
|
-
# ?hurricane
|
80
|
-
def hurricane(msg)
|
81
|
-
url = URI.encode "http://api.wunderground.com/api/#{Zsec.wunderground}/currenthurricane/view.json"
|
82
|
-
location = JSON.parse(
|
83
|
-
# RestClient.get(url)
|
84
|
-
open(url).read
|
85
|
-
)
|
86
|
-
return msg.reply "No results found for #{query}." if location.nil?
|
87
|
-
reply_msg = "∴ #{location['currenthurricane'][0]['stormInfo']['stormName_Nice']} " \
|
88
|
-
"(#{location['currenthurricane'][0]['stormInfo']['stormNumber']}) "\
|
89
|
-
"≈ Category #{location['currenthurricane'][0]['Current']['SaffirSimpsonCategory']} " \
|
90
|
-
"≈ Wind #{location['currenthurricane'][0]['Current']['WindSpeed']['Mph']} mph " \
|
91
|
-
"(#{location['currenthurricane'][0]['Current']['WindSpeed']['Kph']} kph) " \
|
92
|
-
"≈ Wind Gust #{location['currenthurricane'][0]['Current']['WindGust']['Mph']} mph " \
|
93
|
-
"(#{location['currenthurricane'][0]['Current']['WindGust']['Kph']} kph) " \
|
94
|
-
"≈ #{location['currenthurricane'][0]['Current']['Time']['pretty']} ∴"
|
95
|
-
msg.reply(reply_msg)
|
96
|
-
end
|
97
|
-
|
98
|
-
# ?almanac <location>
|
99
|
-
def almanac(msg, locale)
|
100
|
-
autocomplete = JSON.parse(open(URI.encode("http://autocomplete.wunderground.com/aq?query=#{locale}")).read)
|
101
|
-
url = URI.encode("http://api.wunderground.com/api/#{Config.secrets[:wunderground]}/almanac/#{autocomplete['RESULTS'][0]['l']}.json")
|
102
|
-
location = JSON.parse(
|
103
|
-
# RestClient.get(url)
|
104
|
-
open(url).read
|
105
|
-
)
|
106
|
-
return msg.reply "No results found for #{query}." if location.nil?
|
107
|
-
|
108
|
-
time = Time.now()
|
109
|
-
|
110
|
-
data = OpenStruct.new(
|
111
|
-
date: time.strftime('%B, %d %Y (%A) '),
|
112
|
-
airport: location['almanac']['airport_code'],
|
113
|
-
high_norm_f: location['almanac']['temp_high']['normal']['F'],
|
114
|
-
high_norm_c: location['almanac']['temp_high']['normal']['C'],
|
115
|
-
high_record_y: location['almanac']['temp_high']['recordyear'],
|
116
|
-
high_record_f: location['almanac']['temp_high']['record']['F'],
|
117
|
-
high_record_c: location['almanac']['temp_high']['normal']['C'],
|
118
|
-
low_norm_f: location['almanac']['temp_low']['normal']['F'],
|
119
|
-
low_norm_c: location['almanac']['temp_low']['normal']['C'],
|
120
|
-
low_record_y: location['almanac']['temp_low']['recordyear'],
|
121
|
-
low_record_f: location['almanac']['temp_low']['record']['F'],
|
122
|
-
low_record_c: location['almanac']['temp_low']['normal']['C'],
|
123
|
-
)
|
124
|
-
|
125
|
-
reply_msg = "∴ Almanac #{data.date} ≈ Airport #{data.airport} " \
|
126
|
-
"≈ Normal #{data.high_norm_f} F (#{data.high_norm_c} C) | #{data.low_norm_f} F (#{data.low_norm_c} C) " \
|
127
|
-
"≈ High #{data.high_record_f} F (#{data.high_record_c} C) [#{data.high_record_y}] " \
|
128
|
-
"≈ Low #{data.low_record_f} F (#{data.low_record_c} C) [#{data.low_record_y}] ∴"
|
129
|
-
|
130
|
-
msg.reply(reply_msg)
|
131
|
-
end
|
132
|
-
|
133
|
-
|
134
79
|
# -private
|
135
80
|
private
|
136
|
-
#### Weather Sources
|
137
|
-
# Weather Underground - https://wunderground.com
|
138
|
-
def wu_src(location)
|
139
|
-
# Fuzzy location lookup
|
140
|
-
ac = JSON.parse(
|
141
|
-
open(URI.encode("https://autocomplete.wunderground.com/aq?query=#{location}")).read,
|
142
|
-
object_class: OpenStruct
|
143
|
-
)
|
144
|
-
return nil if ac.RESULTS.empty?
|
145
|
-
|
146
|
-
ac = ac.RESULTS[0]
|
147
|
-
geolookup = JSON.parse(
|
148
|
-
open(URI.encode("https://api.wunderground.com/api/#{Config.secrets[:wunderground]}/geolookup/#{ac.l}.json")).read,
|
149
|
-
object_class: OpenStruct
|
150
|
-
).location.l rescue nil
|
151
|
-
|
152
|
-
# Get Data
|
153
|
-
data = JSON.parse(
|
154
|
-
open("https://api.wunderground.com/api/#{Config.secrets[:wunderground]}/alerts/conditions#{geolookup}.json").read,
|
155
|
-
object_class: OpenStruct
|
156
|
-
)
|
157
|
-
|
158
|
-
debug "DATA: #{data}"
|
159
|
-
data.ac = ac
|
160
|
-
current = data.current_observation
|
161
|
-
alerts = data.alerts.empty? ? 'none' : data.alerts.map {|l| l['type']}.join(',')
|
162
|
-
# pressure_si = Unitwise((current.pressure_in.to_f)+14.7, '[psi]').convert_to('kPa').to_f.round(2)
|
163
|
-
|
164
|
-
data.reply = "WU ∴ #{ac.name}, #{ac.c} " \
|
165
|
-
"≈ #{current.weather} #{current.temperature_string} " \
|
166
|
-
"≈ Feels like #{current.feelslike_string} " \
|
167
|
-
"≈ Humidity: #{current.relative_humidity} " \
|
168
|
-
"≈ Pressure: #{current.pressure_in} in/Hg (#{current.pressure_mb} mbar) " \
|
169
|
-
"≈ Wind: #{current.wind_string} ≈ Alerts: #{alerts} ∴"
|
170
|
-
return data
|
171
|
-
# rescue
|
172
|
-
# return nil
|
173
|
-
end
|
174
81
|
|
175
82
|
# Open Weather map - https://openweathermap.org/api
|
176
83
|
def owm_src(location)
|
177
84
|
ac = JSON.parse(
|
178
|
-
open(URI.encode("
|
85
|
+
open(URI.encode("https://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
|
179
86
|
object_class: OpenStruct
|
180
87
|
)
|
181
88
|
|
@@ -194,13 +101,14 @@ module Plugins
|
|
194
101
|
)
|
195
102
|
|
196
103
|
temp = Unitwise(data.main.temp, 'K') # Data is given in kelvin
|
197
|
-
pressure = Unitwise(
|
104
|
+
pressure = Unitwise(data.main.pressure.to_f, 'mbar')
|
198
105
|
wind = Unitwise(data.wind.speed, 'kilometer')
|
199
106
|
|
200
107
|
data.reply = "OWM ∴ #{ac.formatted_address} " \
|
201
108
|
"≈ #{data.weather[0].description}, #{temp.convert_to('[degF]').to_i.round(2)} F (#{temp.convert_to('Cel').to_i.round(2)} C) " \
|
202
109
|
"≈ Humidity: #{data.main.humidity}% " \
|
203
|
-
"≈ Pressure: #{pressure.convert_to('[
|
110
|
+
"≈ Pressure: #{pressure.convert_to('[in_i\'Hg]').to_f.round(2)} in/Hg " \
|
111
|
+
"(#{pressure.convert_to("kPa").to_f.round(2)} kPa) " \
|
204
112
|
"≈ Wind: #{wind.convert_to('mile').to_i.round(2)} mph (#{wind.to_i.round(2)} km/h) ∴"
|
205
113
|
|
206
114
|
return data
|
@@ -210,7 +118,7 @@ module Plugins
|
|
210
118
|
# DarkSky - https://darksky.net/dev
|
211
119
|
def darksky_src(location)
|
212
120
|
ac = JSON.parse(
|
213
|
-
open(URI.encode("
|
121
|
+
open(URI.encode("https://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
|
214
122
|
object_class: OpenStruct
|
215
123
|
)
|
216
124
|
return nil if ac.results.nil? ## Unable to locate
|
@@ -230,7 +138,7 @@ module Plugins
|
|
230
138
|
alerts = data.alerts.count rescue 0
|
231
139
|
c = Unitwise(current.temperature, '[degF]').convert_to('Cel').to_i
|
232
140
|
c_feels = Unitwise(current.apparentTemperature, '[degF]').convert_to('Cel').to_i
|
233
|
-
p = Unitwise(
|
141
|
+
p = Unitwise(current.pressure.to_f, 'mbar')
|
234
142
|
gusts = Unitwise(current.windGust, 'mile').convert_to('kilometer').to_i
|
235
143
|
|
236
144
|
tempstring = "#{current.temperature.to_i} F (#{c} C)"
|
@@ -240,7 +148,8 @@ module Plugins
|
|
240
148
|
"≈ #{current.summary} #{tempstring} " \
|
241
149
|
"≈ Feels like #{feelslike} " \
|
242
150
|
"≈ Humidity: #{current.relative_humidity} " \
|
243
|
-
"≈ Pressure: #{p.convert_to('[
|
151
|
+
"≈ Pressure: #{p.convert_to('[in_i\'Hg]').to_f.round(2)} in/Hg " \
|
152
|
+
"(#{p.convert_to("kPa").to_f.round(2)} kPa) " \
|
244
153
|
"≈ Wind: gusts upto #{current.windGust} mph (#{gusts} km/h) ≈ Alerts: #{alerts} ∴"
|
245
154
|
|
246
155
|
return data
|
@@ -251,7 +160,7 @@ module Plugins
|
|
251
160
|
# NOAA - https://graphical.weather.gov/xml/
|
252
161
|
def noaa_src(location)
|
253
162
|
ac = JSON.parse(
|
254
|
-
open(URI.encode("
|
163
|
+
open(URI.encode("https://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
|
255
164
|
object_class: OpenStruct
|
256
165
|
)
|
257
166
|
return nil if ac.results.nil? ## Unable to locate
|
@@ -278,13 +187,14 @@ module Plugins
|
|
278
187
|
temp = "#{f.round(2)} F (#{data.temperature.value.to_i.round(2)} C) "
|
279
188
|
wind = "Gusts: #{data.windGust.value} avg: #{data.windSpeed.value.to_i.round(2)}"
|
280
189
|
feelslike = "#{data.windChill.value.to_i.round(2)} C"
|
281
|
-
pressure = Unitwise(data.barometricPressure.value.to_f
|
190
|
+
pressure = Unitwise(data.barometricPressure.value.to_f, 'Pa')
|
282
191
|
|
283
192
|
data.reply = "NOAA ∴ #{ac.formatted_address} " \
|
284
193
|
"≈ #{data.textDescription} #{temp} " \
|
285
194
|
"≈ Feels like #{feelslike} " \
|
286
195
|
"≈ Humidity: #{data.relativeHumidity.value.round(2)} " \
|
287
|
-
"≈ Pressure: #{pressure.convert_to('[
|
196
|
+
"≈ Pressure: #{pressure.convert_to('[in_i\'Hg]').to_f.round(2)} in/Hg " \
|
197
|
+
"(#{pressure.convert_to("kPa").to_f.round(2)} kPa) " \
|
288
198
|
"≈ Wind: #{wind} ≈ Alerts: ∴"
|
289
199
|
return data
|
290
200
|
# rescue
|
data/lib/Zeta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zetabot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liothen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -654,8 +654,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
654
654
|
- !ruby/object:Gem::Version
|
655
655
|
version: '0'
|
656
656
|
requirements: []
|
657
|
-
|
658
|
-
rubygems_version: 2.7.6
|
657
|
+
rubygems_version: 3.0.1
|
659
658
|
signing_key:
|
660
659
|
specification_version: 4
|
661
660
|
summary: Zeta is a IRC bot written in ruby using the Cinch Framework
|