zetabot 2.0.0 → 2.0.1
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/.bundle/config +2 -0
- data/Gemfile.lock +36 -36
- data/README.md +144 -41
- data/lib/Zeta/gems.locked +10 -0
- data/lib/Zeta/plugins/seen.rb +8 -17
- data/lib/Zeta/plugins/snooper.rb +13 -12
- data/lib/Zeta/plugins/weather.rb +3 -2
- data/lib/Zeta/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed044e37e911043426ff36017bdebb1e8c437773b3bf7a6ba54c4921dc0bf244
|
|
4
|
+
data.tar.gz: '009ffbd654540ef687531b74bb05bec2c743836bf44ccddd64807ce532b7570f'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70212106c37c86eed94b4f05dd87c6a99c1d7bc68ecc47b4f12984ab39c2fba6ceedf7812b4cbae54ed505c0e05586f91001fd0a3a0c716f2500f0e32b086e21
|
|
7
|
+
data.tar.gz: de0e3a5dbb7e0d82666d031b75e0c6d7683fdc2e5671dd3a4d7c12b6cf5010971d3930334a3ea044d0eddd7f15bc8b13e8204b146b43c36518e83075f5340657
|
data/.bundle/config
ADDED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zetabot (
|
|
4
|
+
zetabot (2.0.0)
|
|
5
5
|
actionview
|
|
6
6
|
chronic
|
|
7
7
|
chronic_duration
|
|
@@ -42,13 +42,13 @@ 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.3)
|
|
46
|
+
activesupport (= 5.2.3)
|
|
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.3)
|
|
52
52
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
53
53
|
i18n (>= 0.7, < 2)
|
|
54
54
|
minitest (~> 5.1)
|
|
@@ -77,7 +77,7 @@ GEM
|
|
|
77
77
|
coderay (~> 1.1)
|
|
78
78
|
method_source (~> 0.9)
|
|
79
79
|
coderay (1.1.2)
|
|
80
|
-
concurrent-ruby (1.1.
|
|
80
|
+
concurrent-ruby (1.1.5)
|
|
81
81
|
connection_pool (2.2.2)
|
|
82
82
|
crack (0.4.3)
|
|
83
83
|
safe_yaml (~> 1.0.0)
|
|
@@ -90,18 +90,18 @@ 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.36.0)
|
|
94
94
|
faraday (~> 0.9)
|
|
95
95
|
faraday_middleware (~> 0.10)
|
|
96
96
|
rack (>= 1.6)
|
|
97
97
|
dnsbl-client (1.0.4)
|
|
98
|
-
domain_name (0.5.
|
|
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
103
|
erubi (1.8.0)
|
|
104
|
-
every_day_irb (2.
|
|
104
|
+
every_day_irb (2.1.0)
|
|
105
105
|
cd (~> 1.0)
|
|
106
106
|
fancy_irb (1.1.0)
|
|
107
107
|
paint (>= 0.9, < 3.0)
|
|
@@ -110,7 +110,7 @@ GEM
|
|
|
110
110
|
multipart-post (>= 1.2, < 3)
|
|
111
111
|
faraday_middleware (0.13.1)
|
|
112
112
|
faraday (>= 0.7.4, < 1.0)
|
|
113
|
-
ffi (1.
|
|
113
|
+
ffi (1.11.1)
|
|
114
114
|
geocoder (1.5.1)
|
|
115
115
|
gist (5.0.0)
|
|
116
116
|
github_api (0.18.2)
|
|
@@ -119,7 +119,7 @@ GEM
|
|
|
119
119
|
faraday (~> 0.8)
|
|
120
120
|
hashie (~> 3.5, >= 3.5.2)
|
|
121
121
|
oauth2 (~> 1.0)
|
|
122
|
-
haml (5.
|
|
122
|
+
haml (5.1.2)
|
|
123
123
|
temple (>= 0.8.0)
|
|
124
124
|
tilt
|
|
125
125
|
hashery (2.1.2)
|
|
@@ -127,29 +127,29 @@ GEM
|
|
|
127
127
|
hirb (0.7.3)
|
|
128
128
|
http-cookie (1.0.3)
|
|
129
129
|
domain_name (~> 0.5)
|
|
130
|
-
httparty (0.
|
|
130
|
+
httparty (0.17.0)
|
|
131
131
|
mime-types (~> 3.0)
|
|
132
132
|
multi_xml (>= 0.5.2)
|
|
133
133
|
humanize-bytes (2.2.0)
|
|
134
134
|
i18n (1.6.0)
|
|
135
135
|
concurrent-ruby (~> 1.0)
|
|
136
|
-
instance (0.2.0)
|
|
137
136
|
interactive_editor (0.0.11)
|
|
138
137
|
spoon (>= 0.0.1)
|
|
139
138
|
ipaddress (0.8.3)
|
|
140
|
-
|
|
139
|
+
irb (1.0.0)
|
|
140
|
+
irbtools (3.0.0)
|
|
141
141
|
binding.repl (~> 3.0)
|
|
142
|
-
clipboard (~> 1.
|
|
143
|
-
code (
|
|
142
|
+
clipboard (~> 1.3)
|
|
143
|
+
code (>= 0.9.2, < 2.0)
|
|
144
144
|
coderay (~> 1.1)
|
|
145
145
|
debugging (~> 1.1)
|
|
146
146
|
every_day_irb (~> 2.0)
|
|
147
147
|
fancy_irb (~> 1.1)
|
|
148
148
|
hirb (~> 0.7, >= 0.7.3)
|
|
149
|
-
instance (~> 0.2)
|
|
150
149
|
interactive_editor (~> 0.0, >= 0.0.10)
|
|
151
|
-
|
|
152
|
-
methodfinder (~> 2.
|
|
150
|
+
irb (>= 0.9.6)
|
|
151
|
+
methodfinder (~> 2.2)
|
|
152
|
+
object_shadow (~> 1.1)
|
|
153
153
|
ori (~> 0.1.0)
|
|
154
154
|
os
|
|
155
155
|
paint (>= 0.9, < 3.0)
|
|
@@ -158,7 +158,7 @@ GEM
|
|
|
158
158
|
ruby_version (~> 1.0)
|
|
159
159
|
wirb (~> 2.0)
|
|
160
160
|
iso8601 (0.9.1)
|
|
161
|
-
jwt (2.1
|
|
161
|
+
jwt (2.2.1)
|
|
162
162
|
liner (0.2.4)
|
|
163
163
|
loofah (2.2.3)
|
|
164
164
|
crass (~> 1.0.2)
|
|
@@ -174,24 +174,23 @@ GEM
|
|
|
174
174
|
webrobots (>= 0.0.9, < 0.2)
|
|
175
175
|
memoizable (0.4.2)
|
|
176
176
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
177
|
-
method_locator (0.0.4)
|
|
178
177
|
method_source (0.9.2)
|
|
179
178
|
methodfinder (2.2.1)
|
|
180
179
|
mime-types (3.2.2)
|
|
181
180
|
mime-types-data (~> 3.2015)
|
|
182
|
-
mime-types-data (3.
|
|
181
|
+
mime-types-data (3.2019.0331)
|
|
183
182
|
mini_portile2 (2.4.0)
|
|
184
183
|
minitest (5.11.3)
|
|
185
184
|
mkfifo (0.1.1)
|
|
186
185
|
multi_json (1.13.1)
|
|
187
186
|
multi_xml (0.6.0)
|
|
188
|
-
multipart-post (2.
|
|
187
|
+
multipart-post (2.1.1)
|
|
189
188
|
net-http-digest_auth (1.4.1)
|
|
190
|
-
net-http-persistent (3.
|
|
189
|
+
net-http-persistent (3.1.0)
|
|
191
190
|
connection_pool (~> 2.2)
|
|
192
|
-
net_http_timeout_errors (0.3.
|
|
191
|
+
net_http_timeout_errors (0.3.5)
|
|
193
192
|
netrc (0.11.0)
|
|
194
|
-
nokogiri (1.10.
|
|
193
|
+
nokogiri (1.10.4)
|
|
195
194
|
mini_portile2 (~> 2.4.0)
|
|
196
195
|
ntlm-http (0.1.1)
|
|
197
196
|
numerizer (0.1.1)
|
|
@@ -201,26 +200,27 @@ GEM
|
|
|
201
200
|
multi_json (~> 1.3)
|
|
202
201
|
multi_xml (~> 0.5)
|
|
203
202
|
rack (>= 1.2, < 3)
|
|
203
|
+
object_shadow (1.1.0)
|
|
204
204
|
oga (2.15)
|
|
205
205
|
ast
|
|
206
206
|
ruby-ll (~> 2.1)
|
|
207
207
|
ori (0.1.0)
|
|
208
|
-
os (1.0.
|
|
208
|
+
os (1.0.1)
|
|
209
209
|
paint (2.1.0)
|
|
210
210
|
parslet (1.8.2)
|
|
211
|
-
pdf-reader (2.2.
|
|
211
|
+
pdf-reader (2.2.1)
|
|
212
212
|
Ascii85 (~> 1.0.0)
|
|
213
213
|
afm (~> 0.2.1)
|
|
214
214
|
hashery (~> 2.0)
|
|
215
215
|
ruby-rc4
|
|
216
216
|
ttfunk
|
|
217
217
|
persist (1.0.0)
|
|
218
|
-
public_suffix (3.
|
|
219
|
-
rack (2.0.
|
|
218
|
+
public_suffix (3.1.1)
|
|
219
|
+
rack (2.0.7)
|
|
220
220
|
rails-dom-testing (2.0.3)
|
|
221
221
|
activesupport (>= 4.2.0)
|
|
222
222
|
nokogiri (>= 1.6)
|
|
223
|
-
rails-html-sanitizer (1.0
|
|
223
|
+
rails-html-sanitizer (1.2.0)
|
|
224
224
|
loofah (~> 2.2, >= 2.2.2)
|
|
225
225
|
rake (10.5.0)
|
|
226
226
|
recursive-open-struct (1.1.0)
|
|
@@ -232,15 +232,15 @@ GEM
|
|
|
232
232
|
rspec-core (~> 3.8.0)
|
|
233
233
|
rspec-expectations (~> 3.8.0)
|
|
234
234
|
rspec-mocks (~> 3.8.0)
|
|
235
|
-
rspec-core (3.8.
|
|
235
|
+
rspec-core (3.8.2)
|
|
236
236
|
rspec-support (~> 3.8.0)
|
|
237
|
-
rspec-expectations (3.8.
|
|
237
|
+
rspec-expectations (3.8.4)
|
|
238
238
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
239
239
|
rspec-support (~> 3.8.0)
|
|
240
|
-
rspec-mocks (3.8.
|
|
240
|
+
rspec-mocks (3.8.1)
|
|
241
241
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
242
242
|
rspec-support (~> 3.8.0)
|
|
243
|
-
rspec-support (3.8.
|
|
243
|
+
rspec-support (3.8.2)
|
|
244
244
|
ruby-ll (2.1.2)
|
|
245
245
|
ansi
|
|
246
246
|
ast
|
|
@@ -262,8 +262,8 @@ GEM
|
|
|
262
262
|
thread_safe (~> 0.1)
|
|
263
263
|
unf (0.1.4)
|
|
264
264
|
unf_ext
|
|
265
|
-
unf_ext (0.0.7.
|
|
266
|
-
unicode-display_width (1.
|
|
265
|
+
unf_ext (0.0.7.6)
|
|
266
|
+
unicode-display_width (1.6.0)
|
|
267
267
|
unitwise (2.2.0)
|
|
268
268
|
liner (~> 0.2)
|
|
269
269
|
memoizable (~> 0.4)
|
data/README.md
CHANGED
|
@@ -1,41 +1,144 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
# Zbot
|
|
2
|
+
Cinch IRC bot written with plenty of help. I will not claim any of the plugins
|
|
3
|
+
And will try to get the correct credits in source
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
Zeta requires ruby >= 2.5.0 and rubygems. Installation beyond that is simple
|
|
7
|
+
|
|
8
|
+
_Steps_
|
|
9
|
+
* gem install zetabot
|
|
10
|
+
* zetabot
|
|
11
|
+
|
|
12
|
+
_Plugins_
|
|
13
|
+
All plugins are automatically loaded that are in the plugins directory
|
|
14
|
+
|
|
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
|
+
## Commands
|
|
24
|
+
roles: owner,admin,operator,halfop,voice,nobody
|
|
25
|
+
prefix: ?
|
|
26
|
+
|
|
27
|
+
### Admin
|
|
28
|
+
_Channel_
|
|
29
|
+
** Role Required: admin/owner **
|
|
30
|
+
* ?join (\#channel) - admin
|
|
31
|
+
* ?part (\#channel) - admin
|
|
32
|
+
* ?quit (\#channel) - owner
|
|
33
|
+
|
|
34
|
+
_Plugins_
|
|
35
|
+
** Role Required: admin **
|
|
36
|
+
* ?plugin load (plugin)
|
|
37
|
+
* ?plugin unload (plugin)
|
|
38
|
+
* ?plugin reload (plugin)
|
|
39
|
+
* ?plugin set (plugin)
|
|
40
|
+
|
|
41
|
+
_Developer_
|
|
42
|
+
** Role Required: owner **
|
|
43
|
+
* ?die (msg) // Kills the bot
|
|
44
|
+
* ?e code // (alias: eval) Evaluate command
|
|
45
|
+
* ?em code // (alias: eval) Evaluate command send in msg
|
|
46
|
+
* ?er code // (alias: evalreply) Evaluate command and send to channel
|
|
47
|
+
|
|
48
|
+
_Ignore_
|
|
49
|
+
** Role Required: operator **
|
|
50
|
+
* ?ignore (user)
|
|
51
|
+
* ?unignore (user)
|
|
52
|
+
|
|
53
|
+
_Channel_
|
|
54
|
+
** Role Required: operator **
|
|
55
|
+
* ?disable (channel) // can omit channel to use current
|
|
56
|
+
* ?enable (channel) // enalbed a channel that has been disabled
|
|
57
|
+
|
|
58
|
+
_Access_
|
|
59
|
+
** Role Required: voice **
|
|
60
|
+
* ?setaccess (user) (level) // Levels: nobody,voice,halfop,operator,admin,owner,founder
|
|
61
|
+
* ?access (user) // Show current access level
|
|
62
|
+
|
|
63
|
+
_Uptime_
|
|
64
|
+
** Role Required: admin **
|
|
65
|
+
* ?uptime // Bot uptime
|
|
66
|
+
* ?sysuptime // grabs the uptime from current system
|
|
67
|
+
* ?users // shows users currently logged into shell
|
|
68
|
+
|
|
69
|
+
### Macros
|
|
70
|
+
Macros are prefixed by a period and are loaded from locales/macros.yml
|
|
71
|
+
example. typing in ".dnf" in channel will cause the bot to respond with "Duke Nukem Forever came out. Your argument is invalid."
|
|
72
|
+
|
|
73
|
+
### FIFO
|
|
74
|
+
Zeta will open a named pipe under bot/zeta.io messages sent to this pipe will be directly sent to the irc server
|
|
75
|
+
|
|
76
|
+
### Plugins
|
|
77
|
+
_Utility_
|
|
78
|
+
* ?calc (query) - Returns a wolframalpha solution
|
|
79
|
+
* ?wiki (term) - Returns a wikipedia entry
|
|
80
|
+
|
|
81
|
+
_Code Runner_
|
|
82
|
+
* ?run (lang) (code)
|
|
83
|
+
* ?langs - lists all of the languages that are supported
|
|
84
|
+
|
|
85
|
+
_Seen_
|
|
86
|
+
* ?seen (user)
|
|
87
|
+
|
|
88
|
+
_Misc_
|
|
89
|
+
* ?attack (target)
|
|
90
|
+
* ?info (plugin)
|
|
91
|
+
* ?fnord
|
|
92
|
+
* ?xmas - days till christmas
|
|
93
|
+
* ?mayan - current day in the mayan calendar
|
|
94
|
+
* ?newyear - days until new years
|
|
95
|
+
* ?heavymetalise (message) - styles the vowles of the text
|
|
96
|
+
* ?rainbow (text) - colorizes your text
|
|
97
|
+
* ?eyerape (text) - even worse then rainbow
|
|
98
|
+
* ?rr (nick) - Play a game of Russian Rullete
|
|
99
|
+
* ?fml - Returns a "F*ck My Life"
|
|
100
|
+
|
|
101
|
+
_GifMe_
|
|
102
|
+
* ?randomgif - grabs a random gif from gifme
|
|
103
|
+
* ?gif (term) - returns the best match from gifme
|
|
104
|
+
|
|
105
|
+
_Movie_
|
|
106
|
+
* ?movie (movie name) :year - the year is optional but must be prefixed with a colon
|
|
107
|
+
|
|
108
|
+
_Urban Dictionary_
|
|
109
|
+
* ?ud (definition) - returns a definition
|
|
110
|
+
* ?wotd - World of the day
|
|
111
|
+
|
|
112
|
+
_Weather_
|
|
113
|
+
* ?w (location)
|
|
114
|
+
* ?wx (location)
|
|
115
|
+
* ?setw (location) - Sets your current location so the bot will remember if you do ?w
|
|
116
|
+
* ?hurricane - gets current hurricane activity
|
|
117
|
+
* ?forecast (location)
|
|
118
|
+
|
|
119
|
+
_PDF Info_
|
|
120
|
+
This plugin grabs the metadata from a pdf that is linked in channel
|
|
121
|
+
|
|
122
|
+
_DBZ_
|
|
123
|
+
responds when you say certain keywords
|
|
124
|
+
|
|
125
|
+
### Network Specific Plugins
|
|
126
|
+
#### FlagRun Networks
|
|
127
|
+
_URL Grabber_
|
|
128
|
+
Grabs metadata from url in channel
|
|
129
|
+
|
|
130
|
+
#### DarkScience
|
|
131
|
+
|
|
132
|
+
_API_
|
|
133
|
+
* ?finger (nick) - pulls nickname information from the DarkScience API
|
|
134
|
+
* ?stats (nick) - pulls statistics information for a nick from the DarkScience API
|
|
135
|
+
* ?peek (channel) - pulls channel information from Darkscience API
|
|
136
|
+
|
|
137
|
+
_QDB_
|
|
138
|
+
* ?addquote (text) - submits quote to DarkScience API
|
|
139
|
+
* ?quote (id) - grabs the quote matching that ID for the specific channel
|
|
140
|
+
* ?quote - grabs random quote for channel
|
|
141
|
+
|
|
142
|
+
_LibSecure_
|
|
143
|
+
** only works in \#libsecure channel **
|
|
144
|
+
* ?latest - grabs the latest post from libsecure
|
data/lib/Zeta/plugins/seen.rb
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
require 'action_view'
|
|
2
2
|
module Plugins
|
|
3
3
|
class Seen
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def to_s
|
|
7
|
-
# "[#{time.asctime}] #{who} was seen in #{where} last saying #{what}"
|
|
8
|
-
time_ago = time_ago_in_words(Time.at(time))
|
|
9
|
-
if where.to_s.upcase == 'STAFF' || where.to_s.upcase == 'SERVICES'
|
|
10
|
-
return ''
|
|
11
|
-
end
|
|
12
|
-
"Seen ∴ \x0304#{who}\x0F was last seen talking in \x1F#{where.to_s.upcase}\x0F \x02#{time_ago}\x0F ago."
|
|
13
|
-
end
|
|
14
|
-
end
|
|
4
|
+
include ActionView::Helpers::DateHelper
|
|
5
|
+
class SeenStruct < Struct.new(:who, :where, :time); end
|
|
15
6
|
|
|
16
7
|
include Cinch::Plugin
|
|
17
8
|
include Cinch::Helpers
|
|
@@ -32,9 +23,8 @@ module Plugins
|
|
|
32
23
|
end
|
|
33
24
|
|
|
34
25
|
def listen(m)
|
|
35
|
-
return if m.channel == '#
|
|
36
|
-
|
|
37
|
-
@users[m.user.nick] = SeenStruct.new(m.user, m.channel, m.message, Time.now)
|
|
26
|
+
return if m.channel == '#services'
|
|
27
|
+
@users[m.user.nick] = SeenStruct.new(m.user, m.channel, Time.now)
|
|
38
28
|
end
|
|
39
29
|
|
|
40
30
|
def execute(m, nick)
|
|
@@ -43,10 +33,11 @@ module Plugins
|
|
|
43
33
|
m.reply 'You are a Stupid human!'
|
|
44
34
|
elsif nick == m.user.nick
|
|
45
35
|
m.reply "Unfortunately, I see an idiot by the name of #{m.user.nick}"
|
|
46
|
-
elsif @users.key?(nick)
|
|
47
|
-
|
|
36
|
+
elsif @users.key?(nick) && (@users[nick].where == m.channel)
|
|
37
|
+
time_ago = time_ago_in_words(Time.at(@users[nick].time))
|
|
38
|
+
m.reply "Seen ∴ \x0304#{@users[nick].who}\x0F was last seen talking in here about \x02#{time_ago}\x0F ago."
|
|
48
39
|
else
|
|
49
|
-
m.reply "I haven't seen #{nick}"
|
|
40
|
+
m.reply "I haven't seen #{nick} say anything yet!"
|
|
50
41
|
end
|
|
51
42
|
end
|
|
52
43
|
|
data/lib/Zeta/plugins/snooper.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
# == Author
|
|
2
|
+
# == Original Author
|
|
3
3
|
# Marvin Gülker (Quintus)
|
|
4
4
|
#
|
|
5
5
|
# == Modification author
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
24
24
|
|
|
25
25
|
# Plugin for inspecting links pasted into channels.
|
|
26
|
+
# F
|
|
26
27
|
require 'video_info'
|
|
27
28
|
require 'mechanize'
|
|
28
29
|
require 'action_view'
|
|
@@ -88,7 +89,7 @@ module Plugins
|
|
|
88
89
|
def match_youtube(msg, url)
|
|
89
90
|
if Config.secrets[:google]
|
|
90
91
|
video = VideoInfo.new(url)
|
|
91
|
-
msg.reply "#{Format(:red, 'YouTube ')}∴ #{video.title} ( #{Format(:green, Time.at(video.duration).strftime("%H:%M:%S"))} )"
|
|
92
|
+
msg.reply "#{Format(:red, 'YouTube ')}∴ #{video.title} ( #{Format(:green, Time.at(video.duration).utc.strftime("%H:%M:%S"))} )"
|
|
92
93
|
else
|
|
93
94
|
match_other(msg, url)
|
|
94
95
|
end
|
|
@@ -96,7 +97,7 @@ module Plugins
|
|
|
96
97
|
end
|
|
97
98
|
|
|
98
99
|
def match_github(msg, url)
|
|
99
|
-
# TODO parse github url
|
|
100
|
+
# TODO: parse github url
|
|
100
101
|
end
|
|
101
102
|
|
|
102
103
|
def match_imgur(msg, url)
|
|
@@ -105,20 +106,20 @@ module Plugins
|
|
|
105
106
|
|
|
106
107
|
# Query Data
|
|
107
108
|
data = JSON.parse(
|
|
108
|
-
RestClient.get("https://api.imgur.com/3/image/#{id[1]}",
|
|
109
|
-
|
|
109
|
+
RestClient.get("https://api.imgur.com/3/image/#{id[1]}",
|
|
110
|
+
{ Authorization: "Client-ID #{Config.secrets[:imgur_id]}" }
|
|
111
|
+
)
|
|
112
|
+
)
|
|
110
113
|
return 'Unable to query imgur' unless defined?(data)
|
|
114
|
+
|
|
111
115
|
i = Hashie::Mash.new(data)
|
|
112
116
|
|
|
113
117
|
# SET Not Safe For Work
|
|
114
|
-
|
|
115
|
-
nsf = "[#{Format(:red, 'NSFW')}]"
|
|
116
|
-
else
|
|
117
|
-
nsf = "[#{Format(:green, 'SAFE')}]"
|
|
118
|
-
end
|
|
118
|
+
nsf = i.data.nsfw ? "[#{Format(:red, 'NSFW')}]" : "[#{Format(:green, 'SAFE')}]"
|
|
119
119
|
|
|
120
120
|
# Trigger reply message
|
|
121
|
-
msg.reply("#{Format(:purple, 'IMGUR')} #{nsf}
|
|
121
|
+
msg.reply("#{Format(:purple, 'IMGUR')} #{nsf} "\
|
|
122
|
+
"∴ [#{Format(:yellow, i.data.type)}] #{i.data.width}x#{i.data.height} "\
|
|
122
123
|
"∴ Views: #{ i.data.views.to_s} ∴ #{i.data.title ? i.data.title[0..100] : 'No Title'} "\
|
|
123
124
|
"∴ Posted #{time_ago_in_words(Time.at(i.data.datetime))} ago")
|
|
124
125
|
end
|
|
@@ -126,7 +127,7 @@ module Plugins
|
|
|
126
127
|
def match_other(msg,url)
|
|
127
128
|
begin
|
|
128
129
|
html = Mechanize.start { |m|
|
|
129
|
-
# Timeout
|
|
130
|
+
# Timeout long winded pages
|
|
130
131
|
m.max_history = 1
|
|
131
132
|
m.read_timeout = 4
|
|
132
133
|
m.max_file_buffer = 2_097_152
|
data/lib/Zeta/plugins/weather.rb
CHANGED
|
@@ -105,6 +105,7 @@ module Plugins
|
|
|
105
105
|
wind = Unitwise(data.wind.speed, 'kilometer')
|
|
106
106
|
|
|
107
107
|
data.reply = "OWM ∴ #{ac.formatted_address} " \
|
|
108
|
+
"≈ #{Time.now.change(offset: data.timezone).strftime("%a %D %l:%M %P")} " \
|
|
108
109
|
"≈ #{data.weather[0].description}, #{temp.convert_to('[degF]').to_i.round(2)} F (#{temp.convert_to('Cel').to_i.round(2)} C) " \
|
|
109
110
|
"≈ Humidity: #{data.main.humidity}% " \
|
|
110
111
|
"≈ Pressure: #{pressure.convert_to('[in_i\'Hg]').to_f.round(2)} in/Hg " \
|
|
@@ -142,11 +143,11 @@ module Plugins
|
|
|
142
143
|
gusts = Unitwise(current.windGust, 'mile').convert_to('kilometer').to_i
|
|
143
144
|
|
|
144
145
|
tempstring = "#{current.temperature.to_i} F (#{c} C)"
|
|
145
|
-
feelslike = "#{current.apparentTemperature.to_i} F (#{c_feels} C)"
|
|
146
|
+
# feelslike = "#{current.apparentTemperature.to_i} F (#{c_feels} C)"
|
|
146
147
|
|
|
147
148
|
data.reply = "DS ∴ #{ac.formatted_address} " \
|
|
149
|
+
"≈ #{Time.at(current.time).strftime("%a %D %l:%M %P")} " \
|
|
148
150
|
"≈ #{current.summary} #{tempstring} " \
|
|
149
|
-
"≈ Feels like #{feelslike} " \
|
|
150
151
|
"≈ Humidity: #{current.relative_humidity} " \
|
|
151
152
|
"≈ Pressure: #{p.convert_to('[in_i\'Hg]').to_f.round(2)} in/Hg " \
|
|
152
153
|
"(#{p.convert_to("kPa").to_f.round(2)} kPa) " \
|
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.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Liothen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-08-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -564,6 +564,7 @@ executables:
|
|
|
564
564
|
extensions: []
|
|
565
565
|
extra_rdoc_files: []
|
|
566
566
|
files:
|
|
567
|
+
- ".bundle/config"
|
|
567
568
|
- ".gitignore"
|
|
568
569
|
- Gemfile
|
|
569
570
|
- Gemfile.lock
|
|
@@ -591,6 +592,7 @@ files:
|
|
|
591
592
|
- lib/Zeta/cache.rb
|
|
592
593
|
- lib/Zeta/cinch.rb
|
|
593
594
|
- lib/Zeta/config.rb
|
|
595
|
+
- lib/Zeta/gems.locked
|
|
594
596
|
- lib/Zeta/gems.rb
|
|
595
597
|
- lib/Zeta/locale.rb
|
|
596
598
|
- lib/Zeta/locale/en/8ball.yml
|
|
@@ -654,7 +656,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
654
656
|
- !ruby/object:Gem::Version
|
|
655
657
|
version: '0'
|
|
656
658
|
requirements: []
|
|
657
|
-
rubygems_version: 3.0.
|
|
659
|
+
rubygems_version: 3.0.3
|
|
658
660
|
signing_key:
|
|
659
661
|
specification_version: 4
|
|
660
662
|
summary: Zeta is a IRC bot written in ruby using the Cinch Framework
|