lita-onewheel-images 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/onewheel_images.rb +5 -0
- data/lita-onewheel-images.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02fdc36ed43aa760c4835d35b4520e1b2bc92b2a
|
4
|
+
data.tar.gz: 50301047dc61886aa1cee05a40c88017c7f62059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee514ddcf4c11287ea998591e12e881416b5426d77714156779a2d211ce48b814bdc2dd382d83d8fbd180d202d2b4dd897cd90288c594bebbd89d00477a9c72f
|
7
|
+
data.tar.gz: 9cd96c7617b284f6c438ba3fcc8179bf98367b65f2ae6f15dbdc9e060aa11e0a88931f83a582b3fd39116e8ead0b8a3bc48e4b9376577a5af6dee60d382d7cb0
|
@@ -7,6 +7,7 @@ module Lita
|
|
7
7
|
config :google_api_key
|
8
8
|
config :safe_search, required: false, default: 'medium'
|
9
9
|
config :giphy_enabled, required: false, default: true
|
10
|
+
config :search_prefix, required: false, default: ''
|
10
11
|
|
11
12
|
route /^image\s+(.*)$/i, :image, command: true
|
12
13
|
route /^img\s+(.*)$/i, :image, command: true
|
@@ -15,6 +16,10 @@ module Lita
|
|
15
16
|
|
16
17
|
def image(response)
|
17
18
|
query = response.matches[0][0]
|
19
|
+
unless config.search_prefix.empty?
|
20
|
+
query = "#{config.search_prefix} #{query}"
|
21
|
+
end
|
22
|
+
|
18
23
|
result = ::OnewheelGoogle::search(query, config.custom_search_engine_id, config.google_api_key, config.safe_search, image = true)
|
19
24
|
Lita.logger.debug "response: #{result['items'][0]['link']}"
|
20
25
|
response.reply result['items'][0]['link']
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-images'
|
3
|
-
spec.version = '0.
|
3
|
+
spec.version = '0.4.0'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = 'An implementation of Google Custom Search Engine for image searches in chat.'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.6.11
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: CSE Details to follow
|