lita-onewheel-duckduckgo 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad3fec901bbeccb17ef3fae7bcb4bed98f9c87f90f517c3d18e358856428d27
|
4
|
+
data.tar.gz: e0cccc70619ee9f1c3e9382bc59e6d5af6e7c0fd14e3ad82ee35fc69d05a6536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be2bdb506f57aa944a295e277b0dc4ff754eeaec6388663d8749184cb378dadfd83d279d9cc0885ed94f9a9f78786dfc5e3cadeda56daf986d4968a697acf9bd
|
7
|
+
data.tar.gz: 0c73457ff364297541d52afd72ece6249e1dd50ee7cee8b9a1b52965da5cf5139704c986d6c6e4f42a56238690ffcc080e8be5b08f5c09b71e22158e902f5929
|
@@ -13,11 +13,10 @@ module Lita
|
|
13
13
|
Lita.logger.debug "Querying for #{query}"
|
14
14
|
result = get_result(query)
|
15
15
|
Lita.logger.debug "Result: #{result}"
|
16
|
-
reply = 'DuckDuckGo Result: '
|
17
16
|
if result['Abstract'].empty?
|
18
|
-
reply
|
17
|
+
reply = result['AbstractURL']
|
19
18
|
else
|
20
|
-
reply
|
19
|
+
reply = result['Abstract'][0..250]
|
21
20
|
end
|
22
21
|
Lita.logger.debug "Reply: #{reply}"
|
23
22
|
response.reply reply
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-duckduckgo'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.5'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = 'Lita handler for Duck Duck Go\'s answers engine.'
|
@@ -18,18 +18,18 @@ describe Lita::Handlers::OnewheelDuckDuckGo, lita_handler: true do
|
|
18
18
|
it 'does neat ducky things' do
|
19
19
|
mock('mock_result')
|
20
20
|
send_command 'duck yo'
|
21
|
-
expect(replies.last).to include('DuckDuckGo
|
21
|
+
expect(replies.last).to include('DuckDuckGo is an Internet search engine that emphasizes')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'uses the url unless the abstract exists' do
|
25
25
|
mock('mock_no_abstract')
|
26
26
|
send_command 'duck yo'
|
27
|
-
expect(replies.last).to include('
|
27
|
+
expect(replies.last).to include('https://en.wikipedia.org/wiki/Duck_(disambiguation)')
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'checks for go' do
|
31
31
|
mock('mock_go')
|
32
32
|
send_command 'duck go'
|
33
|
-
expect(replies.last).to include('
|
33
|
+
expect(replies.last).to include('https://en.wikipedia.org/wiki/Go')
|
34
34
|
end
|
35
35
|
end
|