lita-onewheel-images 0.3.1 → 0.3.2
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 +6 -2
- data/lib/lita-onewheel-images.rb +0 -9
- data/lita-onewheel-images.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4b00dc2240d7c5c09c6fdb80c0d973096b70b47
|
4
|
+
data.tar.gz: 81fb39c5a441099fda833cd9c6f6be44cd28a849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb87b1d23eeb9c9148c6ecf4920d1bfdd2042a776044c0bdf435b22a8b5515dd9ff30934e7df67430c1aa2b472511a821c8570dc9c1a1437474f7931e327398b
|
7
|
+
data.tar.gz: f5439ba4570f82dc76d317676f77b69c93a0161e2fc4fb654fa8f88332d2bd42550351981fda737f5cd07c0ff7fb71f9ce7f9e41365033282b3afaef0dda8575
|
@@ -8,12 +8,15 @@ module Lita
|
|
8
8
|
config :safe_search, required: false, default: 'medium'
|
9
9
|
config :giphy_enabled, required: false, default: true
|
10
10
|
|
11
|
-
route /^image\s+(.*)
|
12
|
-
route /^
|
11
|
+
route /^image\s+(.*)$/i, :image, command: true
|
12
|
+
route /^img\s+(.*)$/i, :image, command: true
|
13
|
+
route /^giphy\s+(.*)$/i, :giphy, command: true
|
14
|
+
route /^gif\s+(.*)$/i, :giphy, command: true
|
13
15
|
|
14
16
|
def image(response)
|
15
17
|
query = response.matches[0][0]
|
16
18
|
result = ::OnewheelGoogle::search(query, config.custom_search_engine_id, config.google_api_key, config.safe_search, image = true)
|
19
|
+
Lita.logger.debug "response: #{result['items'][0]['link']}"
|
17
20
|
response.reply result['items'][0]['link']
|
18
21
|
end
|
19
22
|
|
@@ -32,6 +35,7 @@ module Lita
|
|
32
35
|
r['link'].gsub! /200_s.gif/, 'giphy.gif'
|
33
36
|
end
|
34
37
|
|
38
|
+
Lita.logger.debug "response: #{r['link']}"
|
35
39
|
response.reply r['link']
|
36
40
|
break
|
37
41
|
end
|
data/lib/lita-onewheel-images.rb
CHANGED
@@ -1,12 +1,3 @@
|
|
1
1
|
require 'lita'
|
2
2
|
|
3
|
-
Lita.load_locales Dir[File.expand_path(
|
4
|
-
File.join('..', '..', 'locales', '*.yml'), __FILE__
|
5
|
-
)]
|
6
|
-
|
7
3
|
require 'lita/handlers/onewheel_images'
|
8
|
-
|
9
|
-
Lita::Handlers::OnewheelImages.template_root File.expand_path(
|
10
|
-
File.join('..', '..', 'templates'),
|
11
|
-
__FILE__
|
12
|
-
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-images'
|
3
|
-
spec.version = '0.3.
|
3
|
+
spec.version = '0.3.2'
|
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.
|
4
|
+
version: 0.3.2
|
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-
|
11
|
+
date: 2017-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|