zetabot 2.1.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +56 -51
- data/README.md +17 -9
- data/Zeta.gemspec +2 -2
- data/lib/Zeta/config.rb +2 -0
- data/lib/Zeta/plugins/darkscience.rb +14 -14
- data/lib/Zeta/plugins/weather.rb +5 -46
- data/lib/Zeta/version.rb +1 -1
- metadata +8 -9
- data/.tool-versions +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46af2180fa140b7a4a13ff6aa3238a10641aa49aacd602c1681aa188ba086925
|
4
|
+
data.tar.gz: e9fadf22b7c2ea0e310ab6161a06be6e259ca5b85c469e0cc36e6b0c65be54bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df6c87ba8cffd091d528aeae97be147f5e0e4ed3fd13f1523c43b79112ceb75ffe749040875b08a0921c80336dc59400c17cd3e56d3689061b1dd619414a7a1e
|
7
|
+
data.tar.gz: 807a2d87d838cb17b5e79adcc5ba154d2b207446edf0135eecf58ca846f3b22b44e410cf491096a59f3b165f246cfef787c3422f3fb84cd98865eefbe9744f0f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zetabot (2.
|
4
|
+
zetabot (2.1.1)
|
5
5
|
actionview
|
6
6
|
chronic
|
7
7
|
chronic_duration
|
@@ -26,7 +26,7 @@ PATH
|
|
26
26
|
ipaddress
|
27
27
|
mechanize
|
28
28
|
mkfifo
|
29
|
-
nokogiri
|
29
|
+
nokogiri (~> 1.13.6)
|
30
30
|
pdf-reader
|
31
31
|
persist
|
32
32
|
recursive-open-struct
|
@@ -42,19 +42,19 @@ GEM
|
|
42
42
|
remote: https://rubygems.org/
|
43
43
|
specs:
|
44
44
|
Ascii85 (1.1.0)
|
45
|
-
actionview (7.0.3)
|
46
|
-
activesupport (= 7.0.3)
|
45
|
+
actionview (7.0.4.3)
|
46
|
+
activesupport (= 7.0.4.3)
|
47
47
|
builder (~> 3.1)
|
48
48
|
erubi (~> 1.4)
|
49
49
|
rails-dom-testing (~> 2.0)
|
50
50
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
51
|
-
activesupport (7.0.3)
|
51
|
+
activesupport (7.0.4.3)
|
52
52
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
53
53
|
i18n (>= 1.6, < 2)
|
54
54
|
minitest (>= 5.1)
|
55
55
|
tzinfo (~> 2.0)
|
56
|
-
addressable (2.8.
|
57
|
-
public_suffix (>= 2.0.2, <
|
56
|
+
addressable (2.8.4)
|
57
|
+
public_suffix (>= 2.0.2, < 6.0)
|
58
58
|
afm (0.2.2)
|
59
59
|
ansi (1.5.0)
|
60
60
|
ast (2.4.2)
|
@@ -77,8 +77,8 @@ GEM
|
|
77
77
|
coderay (~> 1.1)
|
78
78
|
method_source (>= 0.9, < 2.0)
|
79
79
|
coderay (1.1.3)
|
80
|
-
concurrent-ruby (1.
|
81
|
-
connection_pool (2.
|
80
|
+
concurrent-ruby (1.2.2)
|
81
|
+
connection_pool (2.4.0)
|
82
82
|
crack (0.4.5)
|
83
83
|
rexml
|
84
84
|
crass (1.0.6)
|
@@ -90,23 +90,23 @@ GEM
|
|
90
90
|
thread_safe (~> 0.3, >= 0.3.1)
|
91
91
|
destructor (0.1.0)
|
92
92
|
diff-lcs (1.5.0)
|
93
|
-
discourse_api (1.
|
93
|
+
discourse_api (1.1.0)
|
94
94
|
faraday (~> 1.0)
|
95
95
|
faraday_middleware (~> 1.0)
|
96
96
|
rack (>= 1.6)
|
97
|
-
dnsbl-client (1.
|
97
|
+
dnsbl-client (1.1.1)
|
98
98
|
domain_name (0.5.20190701)
|
99
99
|
unf (>= 0.0.5, < 1.0.0)
|
100
100
|
dronebl.rb (0.1.0.0)
|
101
101
|
httparty (~> 0.13)
|
102
102
|
nokogiri (~> 1.6)
|
103
|
-
erubi (1.
|
103
|
+
erubi (1.12.0)
|
104
104
|
every_day_irb (2.1.1)
|
105
105
|
cd (~> 1.0)
|
106
106
|
fancy_irb (1.4.3)
|
107
107
|
paint (>= 0.9, < 3.0)
|
108
108
|
unicode-display_width (>= 1.1)
|
109
|
-
faraday (1.10.
|
109
|
+
faraday (1.10.3)
|
110
110
|
faraday-em_http (~> 1.0)
|
111
111
|
faraday-em_synchrony (~> 1.0)
|
112
112
|
faraday-excon (~> 1.1)
|
@@ -132,7 +132,7 @@ GEM
|
|
132
132
|
faraday_middleware (1.2.0)
|
133
133
|
faraday (~> 1.0)
|
134
134
|
ffi (1.15.5)
|
135
|
-
geocoder (1.8.
|
135
|
+
geocoder (1.8.1)
|
136
136
|
gist (6.0.0)
|
137
137
|
github_api (0.19.0)
|
138
138
|
addressable (~> 2.4)
|
@@ -140,8 +140,9 @@ GEM
|
|
140
140
|
faraday (>= 0.8, < 2)
|
141
141
|
hashie (~> 3.5, >= 3.5.2)
|
142
142
|
oauth2 (~> 1.0)
|
143
|
-
haml (
|
144
|
-
temple (>= 0.8.
|
143
|
+
haml (6.1.1)
|
144
|
+
temple (>= 0.8.2)
|
145
|
+
thor
|
145
146
|
tilt
|
146
147
|
hashery (2.1.2)
|
147
148
|
hashie (3.6.0)
|
@@ -149,11 +150,11 @@ GEM
|
|
149
150
|
http-accept (1.7.0)
|
150
151
|
http-cookie (1.0.5)
|
151
152
|
domain_name (~> 0.5)
|
152
|
-
httparty (0.
|
153
|
-
|
153
|
+
httparty (0.21.0)
|
154
|
+
mini_mime (>= 1.0.0)
|
154
155
|
multi_xml (>= 0.5.2)
|
155
156
|
humanize-bytes (2.2.0)
|
156
|
-
i18n (1.
|
157
|
+
i18n (1.13.0)
|
157
158
|
concurrent-ruby (~> 1.0)
|
158
159
|
interactive_editor (0.0.11)
|
159
160
|
spoon (>= 0.0.1)
|
@@ -181,13 +182,13 @@ GEM
|
|
181
182
|
ruby_info (~> 1.0)
|
182
183
|
ruby_version (~> 1.0)
|
183
184
|
wirb (~> 2.0, >= 2.2.1)
|
184
|
-
iso8601 (0.
|
185
|
-
jwt (2.
|
185
|
+
iso8601 (0.13.0)
|
186
|
+
jwt (2.7.0)
|
186
187
|
liner (0.2.4)
|
187
|
-
loofah (2.
|
188
|
+
loofah (2.20.0)
|
188
189
|
crass (~> 1.0.2)
|
189
190
|
nokogiri (>= 1.5.9)
|
190
|
-
mechanize (2.
|
191
|
+
mechanize (2.9.1)
|
191
192
|
addressable (~> 2.8)
|
192
193
|
domain_name (~> 0.5, >= 0.5.20190701)
|
193
194
|
http-cookie (~> 1.0, >= 1.0.3)
|
@@ -204,49 +205,52 @@ GEM
|
|
204
205
|
methodfinder (2.2.4)
|
205
206
|
mime-types (3.4.1)
|
206
207
|
mime-types-data (~> 3.2015)
|
207
|
-
mime-types-data (3.
|
208
|
-
|
208
|
+
mime-types-data (3.2023.0218.1)
|
209
|
+
mini_mime (1.1.2)
|
210
|
+
mini_portile2 (2.8.7)
|
211
|
+
minitest (5.18.0)
|
209
212
|
mkfifo (0.1.1)
|
210
213
|
multi_json (1.15.0)
|
211
214
|
multi_xml (0.6.0)
|
212
|
-
multipart-post (2.
|
215
|
+
multipart-post (2.3.0)
|
213
216
|
net-http-digest_auth (1.4.1)
|
214
|
-
net-http-persistent (4.0.
|
217
|
+
net-http-persistent (4.0.2)
|
215
218
|
connection_pool (~> 2.2)
|
216
|
-
net_http_timeout_errors (0.
|
219
|
+
net_http_timeout_errors (1.0.0)
|
217
220
|
netrc (0.11.0)
|
218
|
-
nokogiri (1.13.
|
221
|
+
nokogiri (1.13.10)
|
222
|
+
mini_portile2 (~> 2.8.0)
|
219
223
|
racc (~> 1.4)
|
220
224
|
numerizer (0.1.1)
|
221
|
-
oauth2 (1.4.
|
225
|
+
oauth2 (1.4.11)
|
222
226
|
faraday (>= 0.17.3, < 3.0)
|
223
227
|
jwt (>= 1.0, < 3.0)
|
224
228
|
multi_json (~> 1.3)
|
225
229
|
multi_xml (~> 0.5)
|
226
|
-
rack (>= 1.2, <
|
230
|
+
rack (>= 1.2, < 4)
|
227
231
|
object_shadow (1.1.1)
|
228
|
-
oga (3.
|
232
|
+
oga (3.4)
|
229
233
|
ast
|
230
234
|
ruby-ll (~> 2.1)
|
231
235
|
ori (0.1.0)
|
232
236
|
os (1.1.4)
|
233
237
|
paint (2.2.1)
|
234
|
-
parslet (
|
235
|
-
pdf-reader (2.
|
238
|
+
parslet (2.0.0)
|
239
|
+
pdf-reader (2.11.0)
|
236
240
|
Ascii85 (~> 1.0)
|
237
241
|
afm (~> 0.2.1)
|
238
242
|
hashery (~> 2.0)
|
239
243
|
ruby-rc4
|
240
244
|
ttfunk
|
241
245
|
persist (1.0.0)
|
242
|
-
public_suffix (
|
243
|
-
racc (1.
|
244
|
-
rack (
|
246
|
+
public_suffix (5.0.1)
|
247
|
+
racc (1.8.0)
|
248
|
+
rack (3.0.7)
|
245
249
|
rails-dom-testing (2.0.3)
|
246
250
|
activesupport (>= 4.2.0)
|
247
251
|
nokogiri (>= 1.6)
|
248
|
-
rails-html-sanitizer (1.
|
249
|
-
loofah (~> 2.
|
252
|
+
rails-html-sanitizer (1.5.0)
|
253
|
+
loofah (~> 2.19, >= 2.19.1)
|
250
254
|
rake (10.5.0)
|
251
255
|
recursive-open-struct (1.1.3)
|
252
256
|
reline (0.3.1)
|
@@ -283,27 +287,28 @@ GEM
|
|
283
287
|
spoon (0.0.6)
|
284
288
|
ffi
|
285
289
|
tag_formatter (0.0.3)
|
286
|
-
temple (0.
|
290
|
+
temple (0.10.0)
|
291
|
+
thor (1.2.1)
|
287
292
|
thread_safe (0.3.6)
|
288
|
-
tilt (2.0
|
293
|
+
tilt (2.1.0)
|
289
294
|
time-lord (1.0.1)
|
290
295
|
ttfunk (1.7.0)
|
291
|
-
tzinfo (2.0.
|
296
|
+
tzinfo (2.0.6)
|
292
297
|
concurrent-ruby (~> 1.0)
|
293
298
|
unf (0.1.4)
|
294
299
|
unf_ext
|
295
300
|
unf_ext (0.0.8.2)
|
296
301
|
unicode-display_width (2.1.0)
|
297
|
-
unitwise (2.
|
302
|
+
unitwise (2.3.0)
|
298
303
|
liner (~> 0.2)
|
299
304
|
memoizable (~> 0.4)
|
300
|
-
parslet (~>
|
305
|
+
parslet (~> 2.0)
|
301
306
|
signed_multiset (~> 0.2)
|
302
|
-
video_info (
|
303
|
-
iso8601 (~> 0.
|
304
|
-
net_http_timeout_errors (~> 0.
|
305
|
-
oga (~> 3.
|
306
|
-
webrick (1.
|
307
|
+
video_info (4.0.0)
|
308
|
+
iso8601 (~> 0.13.0)
|
309
|
+
net_http_timeout_errors (~> 1.0.0)
|
310
|
+
oga (~> 3.4)
|
311
|
+
webrick (1.8.1)
|
307
312
|
webrobots (0.1.2)
|
308
313
|
wirb (2.2.2)
|
309
314
|
paint (>= 0.9, < 3.0)
|
@@ -316,11 +321,11 @@ PLATFORMS
|
|
316
321
|
ruby
|
317
322
|
|
318
323
|
DEPENDENCIES
|
319
|
-
bundler (~> 2.
|
324
|
+
bundler (~> 2.4)
|
320
325
|
irbtools
|
321
326
|
rake (~> 10.0)
|
322
327
|
rspec (~> 3.0)
|
323
328
|
zetabot!
|
324
329
|
|
325
330
|
BUNDLED WITH
|
326
|
-
2.
|
331
|
+
2.4.22
|
data/README.md
CHANGED
@@ -3,23 +3,31 @@ Cinch IRC bot written with plenty of help. I will not claim any of the plugins
|
|
3
3
|
And will try to get the correct credits in source
|
4
4
|
|
5
5
|
# Installation
|
6
|
-
Zeta requires ruby >= 2.
|
6
|
+
Zeta requires ruby >= 2.7.6 and rubygems. Installation beyond that is simple
|
7
7
|
|
8
8
|
_Steps_
|
9
9
|
* gem install zetabot
|
10
10
|
* zetabot
|
11
11
|
|
12
|
+
|
13
|
+
_Docker_
|
14
|
+
|
15
|
+
Zeta will need its config file mounted in the `.zeta/config.rb` image for her to function.
|
16
|
+
|
17
|
+
```dockerfile
|
18
|
+
FROM docker.io/ruby:2.7.6
|
19
|
+
RUN useradd zeta -m
|
20
|
+
USER zeta
|
21
|
+
WORKDIR /home/zeta/
|
22
|
+
RUN mkdir .zeta .zeta/cache .zeta/log && \
|
23
|
+
gem install zetabot
|
24
|
+
# Run zeta
|
25
|
+
CMD [ "zetabot"]
|
26
|
+
```
|
27
|
+
|
12
28
|
_Plugins_
|
13
29
|
All plugins are automatically loaded that are in the plugins directory
|
14
30
|
|
15
|
-
# Upgrade
|
16
|
-
_Steps_
|
17
|
-
* git pull
|
18
|
-
* bundle
|
19
|
-
* update config files to new examples
|
20
|
-
* ruby ./migrate.rb
|
21
|
-
* ruby ./zeta.rb
|
22
|
-
|
23
31
|
## Commands
|
24
32
|
roles: owner,admin,operator,halfop,voice,nobody
|
25
33
|
prefix: ?
|
data/Zeta.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~> 2.
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.4"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
33
|
spec.add_development_dependency "irbtools"
|
@@ -43,7 +43,7 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.add_dependency 'cinch-quotes'
|
44
44
|
|
45
45
|
spec.add_dependency 'mkfifo'
|
46
|
-
spec.add_dependency 'nokogiri'
|
46
|
+
spec.add_dependency 'nokogiri', "~> 1.13.6"
|
47
47
|
spec.add_dependency 'dronebl.rb'
|
48
48
|
spec.add_dependency 'dnsbl-client'
|
49
49
|
|
data/lib/Zeta/config.rb
CHANGED
@@ -34,7 +34,7 @@ module Plugins
|
|
34
34
|
RestClient.post(
|
35
35
|
'https://darchoods.net/api/irc/channel/view',
|
36
36
|
{
|
37
|
-
auth_token: Config.
|
37
|
+
auth_token: Config.quotes_api_key,
|
38
38
|
channel: chan,
|
39
39
|
}
|
40
40
|
)
|
@@ -67,7 +67,7 @@ module Plugins
|
|
67
67
|
RestClient.post(
|
68
68
|
'https://darchoods.net/api/irc/user/view',
|
69
69
|
{
|
70
|
-
auth_token: Config.
|
70
|
+
auth_token: Config.quotes_api_key,
|
71
71
|
username: nick,
|
72
72
|
}
|
73
73
|
)
|
@@ -106,9 +106,9 @@ module Plugins
|
|
106
106
|
begin
|
107
107
|
data = JSON.parse(
|
108
108
|
RestClient.post(
|
109
|
-
|
109
|
+
"https://#{Config.quotes_api_url}/api/irc/user/view",
|
110
110
|
{
|
111
|
-
auth_token: Config.
|
111
|
+
auth_token: Config.quotes_api_key,
|
112
112
|
username: nick,
|
113
113
|
}
|
114
114
|
)
|
@@ -141,9 +141,9 @@ module Plugins
|
|
141
141
|
begin
|
142
142
|
request = JSON.parse(
|
143
143
|
RestClient.post(
|
144
|
-
|
144
|
+
"https://#{Config.quotes_api_url}/api/qdb/create",
|
145
145
|
{
|
146
|
-
auth_token: Config.
|
146
|
+
auth_token: Config.quotes_api_key,
|
147
147
|
channel: m.channel,
|
148
148
|
author: m.user,
|
149
149
|
quote: quote
|
@@ -152,7 +152,7 @@ module Plugins
|
|
152
152
|
)
|
153
153
|
quote = Hashie::Mash.new(request)
|
154
154
|
|
155
|
-
m.reply "Quote ##{quote.
|
155
|
+
m.reply "Quote ##{quote.response.quote.quote_id} added by #{m.user}!"
|
156
156
|
rescue RestClient::Unauthorized
|
157
157
|
m.action_reply "isn't currently authorized to do that"
|
158
158
|
rescue
|
@@ -164,9 +164,9 @@ module Plugins
|
|
164
164
|
begin
|
165
165
|
request = JSON.parse(
|
166
166
|
RestClient.post(
|
167
|
-
|
167
|
+
"https://#{Config.quotes_api_url}/api/qdb/search/byId",
|
168
168
|
{
|
169
|
-
auth_token: Config.
|
169
|
+
auth_token: Config.quotes_api_key,
|
170
170
|
channel: m.channel,
|
171
171
|
quote_id: search
|
172
172
|
}
|
@@ -174,9 +174,9 @@ module Plugins
|
|
174
174
|
)
|
175
175
|
quote = Hashie::Mash.new(request)
|
176
176
|
|
177
|
-
return m.reply 'There is no quote by that ID' unless quote.
|
177
|
+
return m.reply 'There is no quote by that ID' unless quote.response.quote
|
178
178
|
|
179
|
-
m.reply "QDB##{quote.
|
179
|
+
m.reply "QDB##{quote.response.quote.quote_id}: #{quote.response.quote.content}"
|
180
180
|
rescue RestClient::Unauthorized
|
181
181
|
m.action_reply "isn't currently authorized to do that"
|
182
182
|
rescue
|
@@ -189,15 +189,15 @@ module Plugins
|
|
189
189
|
begin
|
190
190
|
request = JSON.parse(
|
191
191
|
RestClient.post(
|
192
|
-
|
193
|
-
{ auth_token: Config.
|
192
|
+
"https://#{Config.quotes_api_url}/api/qdb/random",
|
193
|
+
{ auth_token: Config.quotes_api_key,
|
194
194
|
channel: m.channel
|
195
195
|
}
|
196
196
|
)
|
197
197
|
)
|
198
198
|
quote = Hashie::Mash.new(request)
|
199
199
|
|
200
|
-
m.reply "QDB##{quote.
|
200
|
+
m.reply "QDB##{quote.response.quote.quote_id}: #{quote.response.quote.content}"
|
201
201
|
rescue RestClient::Unauthorized
|
202
202
|
m.action_reply "isn't currently authorized to do that"
|
203
203
|
rescue
|
data/lib/Zeta/plugins/weather.rb
CHANGED
@@ -29,7 +29,7 @@ module Plugins
|
|
29
29
|
|
30
30
|
#####
|
31
31
|
def initialize(*args)
|
32
|
-
@api_src = %w{
|
32
|
+
@api_src = %w{noaa owm}
|
33
33
|
@store = Persist.new(File.join(Dir.home, '.zeta', 'cache', 'weather.pstore'))
|
34
34
|
super
|
35
35
|
end
|
@@ -40,17 +40,17 @@ module Plugins
|
|
40
40
|
# Lookup user from pstore
|
41
41
|
if !@store[msg.user.to_s].nil? && query.nil?
|
42
42
|
stored_location, stored_source = @store[msg.user.to_s].split('::')
|
43
|
-
stored_source = @api_src.include?(stored_source) ? stored_source : '
|
43
|
+
stored_source = @api_src.include?(stored_source) ? stored_source : 'owm'
|
44
44
|
data = send("#{stored_source}_src", stored_location)
|
45
45
|
# location = geolookup(@store[msg.user.to_s])
|
46
46
|
# data = wunderground_src(stored_location, false)
|
47
47
|
elsif query.nil?
|
48
|
-
return msg.reply 'No location set. ?setw <location> :(
|
48
|
+
return msg.reply 'No location set. ?setw <location> :(noaa|owm)'
|
49
49
|
else
|
50
50
|
# data = wu_src(query, true)
|
51
51
|
src = query[/:\w+/].gsub(/:/, '') if query[/:\w+/]
|
52
52
|
query = query.gsub(/:\w+/, '').strip if query
|
53
|
-
true_src = @api_src.include?(src) ? src : '
|
53
|
+
true_src = @api_src.include?(src) ? src : 'owm'
|
54
54
|
data = send("#{true_src}_src", query)
|
55
55
|
end
|
56
56
|
|
@@ -67,7 +67,7 @@ module Plugins
|
|
67
67
|
query = query.gsub(/:\w+/, '').strip if query
|
68
68
|
|
69
69
|
# Sanity Check
|
70
|
-
true_src = @api_src.include?(src) ? src : '
|
70
|
+
true_src = @api_src.include?(src) ? src : 'owm'
|
71
71
|
data = send("#{true_src}_src", query)
|
72
72
|
|
73
73
|
# Error
|
@@ -119,47 +119,6 @@ module Plugins
|
|
119
119
|
return data
|
120
120
|
end
|
121
121
|
|
122
|
-
# DarkSky - https://darksky.net/dev
|
123
|
-
def darksky_src(location)
|
124
|
-
location = CGI.escape(location)
|
125
|
-
|
126
|
-
ac = JSON.parse(
|
127
|
-
RestClient.get("https://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}").body,
|
128
|
-
object_class: OpenStruct
|
129
|
-
)
|
130
|
-
return nil if ac.results.nil? ## Unable to locate
|
131
|
-
|
132
|
-
ac = ac.results[0]
|
133
|
-
lat = ac.geometry.location.lat
|
134
|
-
lon = ac.geometry.location.lng
|
135
|
-
|
136
|
-
data = JSON.parse(
|
137
|
-
RestClient.get("https://api.darksky.net/forecast/#{Config.secrets[:darksky]}/#{lat},#{lon}").body,
|
138
|
-
object_class: OpenStruct
|
139
|
-
)
|
140
|
-
data.ac = ac
|
141
|
-
current = data.currently
|
142
|
-
alerts = data.alerts.count rescue 0
|
143
|
-
c = Unitwise(current.temperature, '[degF]').convert_to('Cel').to_i
|
144
|
-
c_feels = Unitwise(current.apparentTemperature, '[degF]').convert_to('Cel').to_i
|
145
|
-
p = Unitwise(current.pressure.to_f, 'mbar')
|
146
|
-
gusts = Unitwise(current.windGust, 'mile').convert_to('kilometer').to_i
|
147
|
-
|
148
|
-
tempstring = "#{current.temperature.to_i} F (#{c} C)"
|
149
|
-
|
150
|
-
data.reply = "DS ∴ #{ac.formatted_address} " \
|
151
|
-
"≈ #{TZInfo::Timezone.get(data.timezone).now.strftime("%c")} " \
|
152
|
-
"≈ #{current.summary} #{tempstring} " \
|
153
|
-
"≈ Humidity: #{(current.humidity * 100).round(2)}% " \
|
154
|
-
"≈ Pressure: #{p.convert_to('[in_i\'Hg]').to_f.round(2)} in/Hg " \
|
155
|
-
"(#{p.convert_to("kPa").to_f.round(2)} kPa) " \
|
156
|
-
"≈ Wind: gusts upto #{current.windGust} mph (#{gusts} km/h) ≈ Alerts: #{alerts} ∴"
|
157
|
-
|
158
|
-
return data
|
159
|
-
# rescue
|
160
|
-
# return nil
|
161
|
-
end
|
162
|
-
|
163
122
|
# NOAA - https://graphical.weather.gov/xml/
|
164
123
|
def noaa_src(location)
|
165
124
|
location = CGI.escape(location)
|
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: 2.1.
|
4
|
+
version: 2.1.2
|
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: 2024-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.4'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,16 +196,16 @@ dependencies:
|
|
196
196
|
name: nokogiri
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - "
|
199
|
+
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 1.13.6
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- - "
|
206
|
+
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 1.13.6
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: dronebl.rb
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -566,7 +566,6 @@ extra_rdoc_files: []
|
|
566
566
|
files:
|
567
567
|
- ".bundle/config"
|
568
568
|
- ".gitignore"
|
569
|
-
- ".tool-versions"
|
570
569
|
- Gemfile
|
571
570
|
- Gemfile.lock
|
572
571
|
- LICENSE.txt
|
data/.tool-versions
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby 2.7.6
|