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 CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gsearch-parser"
8
- s.version = "0.1.4"
8
+ s.version = "0.2.0"
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"]
@@ -5,17 +5,17 @@ require 'nokogiri'
5
5
  module GSearchParser
6
6
 
7
7
  def GSearchParser.webSearch(query)
8
- GoogleSearch.new(query)
8
+ GoogleWebSearch.new(query)
9
9
  end
10
10
 
11
11
  end
12
12
 
13
13
  ###################################################
14
14
  # #
15
- # GoogleSearch Class #
15
+ # GoogleWebSearch Class #
16
16
  # #
17
17
  ###################################################
18
- class GoogleSearch
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
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.4
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: