Skip to content

Commit

Permalink
Should get rid of second lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Jul 9, 2016
1 parent c5a4f0f commit f18d57e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/lita/handlers/onewheel_google.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'rest-client'
require 'json'
require 'addressable/uri'
require 'onewheel-google'

module Lita
Expand All @@ -15,7 +12,8 @@ class OnewheelGoogle < Handler
def search(response)
query = response.matches[0][0]
result = ::OnewheelGoogle::search(query, config.custom_search_engine_id, config.google_api_key, config.safe_search)
response.reply "#{result['items'][0]['link']} #{result['items'][0]['title']}: #{result['items'][0]['snippet']}"
reply = "#{result['items'][0]['link']} #{result['items'][0]['title']}: #{result['items'][0]['snippet']}"[0..500]
response.reply reply
end

Lita.register_handler(self)
Expand Down
2 changes: 1 addition & 1 deletion lita-onewheel-google.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'lita-onewheel-google'
spec.version = '0.0.5'
spec.version = '0.0.6'
spec.authors = ['Andrew Kreps']
spec.email = ['andrew.kreps@gmail.com']
spec.description = 'An implementation of Google Custom Search Engine for searching in chat.'
Expand Down

0 comments on commit f18d57e

Please sign in to comment.