lita-google 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ed917741df436893f5b14309f4798968d2b97c5
4
- data.tar.gz: 04284ee039a74f78f45dcf134b2452866f79bd5c
3
+ metadata.gz: b91ed17080d92cdfce8fa5de179e87f7101399bc
4
+ data.tar.gz: 2350152a88275e18d0457d61bdabaf37bfd601cb
5
5
  SHA512:
6
- metadata.gz: d92feb72f648f7e538f78841148ba5e5a2487b9fae9976e1bb3ed33075bfbcd276ec3a14224bdadcb7552c43e671962500ba33d9896e26094cf191d1383c231a
7
- data.tar.gz: da1bfa1002ee396d034cabbc98acca9ccea35d5379d0246f41d373f65bc8d71b7c8860b8a04178769b9b1751ab993d85aa638faaf07081b611acdbedcce53f7c
6
+ metadata.gz: 148e2312e849a73aec37ad40ab1a0c6f7a4361334f77b129c4c4937a47ed236c82d0c8d5e7ee3f81209e1f36dd6ef258f22135d30ac49e2e0128685c66cd5b18
7
+ data.tar.gz: 5c36774a0c1877cbb60dd30e13ea327be6f587e0d2e6d055a67c574800b9db91c38ddff0fdb285cacf8fa5f2393c70d68191b5638f83d2091b816b5dc33bf608
@@ -1,3 +1,6 @@
1
+ require "cgi"
2
+ require "uri"
3
+
1
4
  require "lita"
2
5
 
3
6
  module Lita
@@ -28,7 +31,9 @@ module Lita
28
31
  result = data["responseData"]["results"].first
29
32
 
30
33
  if result
31
- response.reply("#{result["titleNoFormatting"]} - #{result["url"]}")
34
+ response.reply(
35
+ "#{CGI.unescapeHTML(result["titleNoFormatting"])} - #{result["unescapedUrl"]}"
36
+ )
32
37
  else
33
38
  response.reply("No search results for query: #{query}")
34
39
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-google"
3
- spec.version = "0.0.3"
3
+ spec.version = "0.0.4"
4
4
  spec.authors = ["Jimmy Cuadra"]
5
5
  spec.email = ["jimmy@jimmycuadra.com"]
6
6
  spec.description = %q{A Lita handler for returning Google search results.}
@@ -23,8 +23,8 @@ describe Lita::Handlers::Google, lita_handler: true do
23
23
  {
24
24
  "responseData": {
25
25
  "results": [{
26
- "url": "https://www.ruby-lang.org/",
27
- "titleNoFormatting": "Ruby Programming Language"
26
+ "unescapedUrl": "http://www.youtube.com/watch?v=EwTZ2xpQwpA",
27
+ "titleNoFormatting": ""Chocolate Rain" Original Song by Tay Zonday"
28
28
  }]
29
29
  }
30
30
  }
@@ -34,7 +34,7 @@ JSON
34
34
  send_command("google ruby")
35
35
 
36
36
  expect(replies.last).to eq(
37
- "Ruby Programming Language - https://www.ruby-lang.org/"
37
+ %{"Chocolate Rain" Original Song by Tay Zonday - http://www.youtube.com/watch?v=EwTZ2xpQwpA}
38
38
  )
39
39
  end
40
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita