gsearch-parser 0.1.4 → 0.2.0
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 +8 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/gsearch-parser.gemspec
CHANGED
data/lib/gsearch-parser.rb
CHANGED
@@ -5,17 +5,17 @@ require 'nokogiri'
|
|
5
5
|
module GSearchParser
|
6
6
|
|
7
7
|
def GSearchParser.webSearch(query)
|
8
|
-
|
8
|
+
GoogleWebSearch.new(query)
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
12
12
|
|
13
13
|
###################################################
|
14
14
|
# #
|
15
|
-
#
|
15
|
+
# GoogleWebSearch Class #
|
16
16
|
# #
|
17
17
|
###################################################
|
18
|
-
class
|
18
|
+
class GoogleWebSearch
|
19
19
|
attr_accessor :results
|
20
20
|
|
21
21
|
# Class initializer
|
@@ -41,6 +41,11 @@ class GoogleSearch
|
|
41
41
|
# Extract the URI
|
42
42
|
uri = result.css('cite').first.inner_html
|
43
43
|
|
44
|
+
# Ignore YouTube videos for websearch
|
45
|
+
unless uri.index('www.youtube.com').nil?
|
46
|
+
next
|
47
|
+
end
|
48
|
+
|
44
49
|
# Create a new Result object and append to the array
|
45
50
|
@results << Result.new(title, content, uri)
|
46
51
|
end
|