gsearch-parser 0.3.5 → 0.3.6
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 +1 -1
- data/gsearch-parser.gemspec +1 -1
- data/lib/gsearch-parser.rb +3 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
data/gsearch-parser.gemspec
CHANGED
data/lib/gsearch-parser.rb
CHANGED
@@ -32,7 +32,7 @@ class GoogleWebSearch
|
|
32
32
|
|
33
33
|
case flag
|
34
34
|
when 'QUERY'
|
35
|
-
updateResults("http://google.com/search?
|
35
|
+
updateResults("http://google.com/search?q=#{arg1}")
|
36
36
|
when 'URI'
|
37
37
|
updateResults(arg1)
|
38
38
|
end
|
@@ -54,7 +54,7 @@ class GoogleWebSearch
|
|
54
54
|
def updateResults(url)
|
55
55
|
# Fetch
|
56
56
|
searchPage = fetchPage(url)
|
57
|
-
|
57
|
+
|
58
58
|
# Store
|
59
59
|
@currentPage = searchPage
|
60
60
|
|
@@ -75,7 +75,7 @@ puts url
|
|
75
75
|
# Iterate over each Google result list element
|
76
76
|
@currentPage.css('li.g').each do |result|
|
77
77
|
# Extract the title
|
78
|
-
title = result.css('h3
|
78
|
+
title = result.css('h3 a').first.inner_html
|
79
79
|
|
80
80
|
# Extract the content. There is the possibility for
|
81
81
|
# the content to be nil, so check for this
|