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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4b00dc2240d7c5c09c6fdb80c0d973096b70b47
4
- data.tar.gz: 81fb39c5a441099fda833cd9c6f6be44cd28a849
3
+ metadata.gz: 02fdc36ed43aa760c4835d35b4520e1b2bc92b2a
4
+ data.tar.gz: 50301047dc61886aa1cee05a40c88017c7f62059
5
5
  SHA512:
6
- metadata.gz: eb87b1d23eeb9c9148c6ecf4920d1bfdd2042a776044c0bdf435b22a8b5515dd9ff30934e7df67430c1aa2b472511a821c8570dc9c1a1437474f7931e327398b
7
- data.tar.gz: f5439ba4570f82dc76d317676f77b69c93a0161e2fc4fb654fa8f88332d2bd42550351981fda737f5cd07c0ff7fb71f9ce7f9e41365033282b3afaef0dda8575
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.2'
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.3.2
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: 2017-08-21 00:00:00.000000000 Z
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.5.2
168
+ rubygems_version: 2.6.11
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: CSE Details to follow