gsearch-parser 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gsearch-parser"
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
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"]
@@ -29,6 +29,15 @@ class GoogleWebSearch
29
29
  updateResults("http://google.com/search?sourceid=chrome&q=#{query}")
30
30
  end
31
31
 
32
+ # Update the nextURI attribute
33
+ def updateNextURI
34
+ # Parse next result page link from the currently marked one
35
+ nextPagePath = @currentPage.at_css("table#nav tr td.cur").next_sibling().at_css("a")['href']
36
+
37
+ # Construct the URI
38
+ @nextURI = "http://www.google.com" + nextPagePath
39
+ end
40
+
32
41
  # Update the WebSearch results array by performing a Fetch, Store, Parse routine
33
42
  def updateResults(url)
34
43
  # Fetch
@@ -77,11 +86,8 @@ class GoogleWebSearch
77
86
 
78
87
  # Parse the results from the next page and append to results list
79
88
  def nextResults
80
- # Parse next result page link from the currently marked one
81
- nextPagePath = @currentPage.at_css("table#nav tr td.cur").next_sibling().at_css("a")['href']
82
-
83
- # Construct the URI
84
- @nextURI = "http://www.google.com" + nextPagePath
89
+ # Update nextURI
90
+ updateNextURI
85
91
 
86
92
  # Update results
87
93
  updateResults(@nextURI)
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.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: