gsearch-parser 0.1.3 → 0.1.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gsearch-parser"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Diego Netto"]
@@ -32,14 +32,11 @@ class GoogleSearch
32
32
  # Iterate over each Google result list element
33
33
  searchPage.css('li.g').each do |result|
34
34
  # Extract the title
35
- title = result.css('h3').first.inner_html
35
+ title = result.css('h3 > a').first.inner_html
36
36
 
37
37
  # Extract the content. There is the possibility for
38
38
  # the content to be nil, so check for this
39
- content = result.css('span.st').first
40
- if !content
41
- content = ''
42
- end
39
+ content = result.css('span.st').first.nil? ? '' : result.css('span.st').first.inner_html
43
40
 
44
41
  # Extract the URI
45
42
  uri = result.css('cite').first.inner_html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gsearch-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: