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 +1 -1
- data/gsearch-parser.gemspec +1 -1
- data/lib/gsearch-parser.rb +11 -5
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/gsearch-parser.gemspec
CHANGED
data/lib/gsearch-parser.rb
CHANGED
@@ -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
|
-
#
|
81
|
-
|
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)
|