google_search_results 1.3.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cf8b604485ff927dae81c9fd1a5017d92563b339bc77994e0365926a14f6192
4
- data.tar.gz: 46cca48662a2bfe6d7b7c79e34b92afa931d3be9e8cf38eb139d6d086068d2c7
3
+ metadata.gz: d6431b13d508a7d2758723df6ff4f0f702e00005daf957789b01f993516e4a37
4
+ data.tar.gz: 8ade7cedec4cfeb413ee4f5ded86ba37a578f5424f88f5ab28bcec9006623983
5
5
  SHA512:
6
- metadata.gz: 6d26a044da90201b3c7e77841e7acc5bce8f0534ad7840df78b42120a7549ca79a3b787af90ad25e1062713b47a0fe7ab32b000a9ada008f27a64421ae97370c
7
- data.tar.gz: 5257a57981176ee85df134f6bc89e1eebf2b16e44d0d3c90ee72a63541359b83e9ac8a69639c41c87d9f8a2eeb6571360bd223bd87b8474f90c3aa0a53b4796d
6
+ metadata.gz: 112a0060aa508a73274f6b96233ec46a7d4256d2d3e5952605a1951da9b8af0225b6f1be61e5fc8d7c149feff52218538a3cb39221fc305d09ed8f387fbf2385
7
+ data.tar.gz: e9d03804d47bd7e84778635e4cf35b14790cad13124572bf23a769a7160b68f26381d42532b15a4a28033ee69f8be1d8fa11c18b252937631a4342d3c5e514ce
@@ -1,39 +1,7 @@
1
- require_relative 'serp_api_client'
2
-
3
- # Google Search Result for Ruby powered by SerpApi
4
- #
5
- # Search API Usage
6
- #
7
- # ```ruby
8
- # parameter = {
9
- # q: "query",
10
- # google_domain: "Google Domain",
11
- # location: "Location Requested",
12
- # device: device,
13
- # hl: "Google UI Language",
14
- # gl: "Google Country",
15
- # safe: "Safe Search Flag",
16
- # num: "Number of Results",
17
- # start: "Pagination Offset",
18
- # tbm: "to be matched field",
19
- # tbs: "to be searched field",
20
- # api_key: "Your SERP API Key"
21
- # }
22
- #
23
- # search = GoogleSearchResults.new(parameter)
24
- # search.params[:location] = "Portland"
25
- #
26
- # html_results = search.get_html
27
- # hash_results = search.get_hash
28
- # json_results = search.get_json
29
- # ```
30
- #
31
- # doc: https://serpapi.com/search-api
32
- class GoogleSearchResults < SerpApiClient
33
-
34
- def initialize(params = {})
35
- super(params, GOOGLE_ENGINE)
36
- check_params([:q, :engine])
37
- end
38
-
39
- end
1
+ require_relative 'search/serp_api_search.rb'
2
+ require_relative 'search/baidu_search.rb'
3
+ require_relative 'search/bing_search.rb'
4
+ require_relative 'search/ebay_search.rb'
5
+ require_relative 'search/google_search.rb'
6
+ require_relative 'search/yahoo_search.rb'
7
+ require_relative 'search/yandex_search.rb'
@@ -1,4 +1,4 @@
1
- require_relative 'serp_api_client'
1
+ require_relative 'serp_api_search'
2
2
 
3
3
  # Baidu Search Result for Ruby powered by SerpApi
4
4
  #
@@ -10,7 +10,7 @@ require_relative 'serp_api_client'
10
10
  # api_key: "Serp API Key"
11
11
  # }
12
12
  #
13
- # search = BaiduSearchResults.new(parameter)
13
+ # search = BaiduSearch.new(parameter)
14
14
  #
15
15
  # html_results = search.get_html
16
16
  # hash_results = search.get_hash
@@ -19,7 +19,7 @@ require_relative 'serp_api_client'
19
19
  # ```
20
20
  # doc: https://serpapi.com/baidu-search-api
21
21
 
22
- class BaiduSearchResults < SerpApiClient
22
+ class BaiduSearch < SerpApiSearch
23
23
 
24
24
  def initialize(params = {})
25
25
  super(params, BING_ENGINE)
@@ -1,4 +1,4 @@
1
- require_relative '../lib/bing_search_results'
1
+ require_relative 'serp_api_search'
2
2
 
3
3
  # Bing Search Result for Ruby powered by SerpApi
4
4
  #
@@ -11,7 +11,7 @@ require_relative '../lib/bing_search_results'
11
11
  # api_key: "Your SERP API Key"
12
12
  # }
13
13
  #
14
- # search = BingSearchResults.new(parameter)
14
+ # search = BingSearch.new(parameter)
15
15
  # search.params[:location] = "Portland"
16
16
  #
17
17
  # html_results = search.get_html
@@ -22,7 +22,7 @@ require_relative '../lib/bing_search_results'
22
22
  #
23
23
  # doc: https://serpapi.com/bing-search-api
24
24
 
25
- class BingSearchResults < SerpApiClient
25
+ class BingSearch < SerpApiSearch
26
26
 
27
27
  def initialize(params = {})
28
28
  super(params, BING_ENGINE)
@@ -1,4 +1,4 @@
1
- require_relative 'serp_api_client'
1
+ require_relative 'serp_api_search'
2
2
 
3
3
  # Ebay Search Result for Ruby powered by SerpApi
4
4
  #
@@ -10,7 +10,7 @@ require_relative 'serp_api_client'
10
10
  # api_key: "Your SERP API Key"
11
11
  # }
12
12
  #
13
- # search = EbaySearchResults.new(parameter)
13
+ # search = EbaySearch.new(parameter)
14
14
  # search.params[:ebay_domain] = "ebay.com"
15
15
  #
16
16
  # html_results = search.get_html
@@ -21,7 +21,7 @@ require_relative 'serp_api_client'
21
21
  #
22
22
  # doc: https://serpapi.com/ebay-search-api
23
23
 
24
- class EbaySearchResults < SerpApiClient
24
+ class EbaySearch < SerpApiSearch
25
25
 
26
26
  def initialize(params = {})
27
27
  super(params, EBAY_ENGINE)
@@ -0,0 +1,39 @@
1
+ require_relative 'serp_api_search'
2
+
3
+ # Google Search Result for Ruby powered by SerpApi
4
+ #
5
+ # Search API Usage
6
+ #
7
+ # ```ruby
8
+ # parameter = {
9
+ # q: "query",
10
+ # google_domain: "Google Domain",
11
+ # location: "Location Requested",
12
+ # device: device,
13
+ # hl: "Google UI Language",
14
+ # gl: "Google Country",
15
+ # safe: "Safe Search Flag",
16
+ # num: "Number of Results",
17
+ # start: "Pagination Offset",
18
+ # tbm: "to be matched field",
19
+ # tbs: "to be searched field",
20
+ # api_key: "Your SERP API Key"
21
+ # }
22
+ #
23
+ # search = GoogleSearch.new(parameter)
24
+ # search.params[:location] = "Portland"
25
+ #
26
+ # html_results = search.get_html
27
+ # hash_results = search.get_hash
28
+ # json_results = search.get_json
29
+ # ```
30
+ #
31
+ # doc: https://serpapi.com/search-api
32
+ class GoogleSearch < SerpApiSearch
33
+
34
+ def initialize(params = {})
35
+ super(params, GOOGLE_ENGINE)
36
+ check_params([:q, :engine])
37
+ end
38
+
39
+ end
@@ -11,9 +11,9 @@ EBAY_ENGINE = 'ebay'
11
11
 
12
12
  # Generic HTTP client for serpapi.com
13
13
  #
14
- class SerpApiClient
14
+ class SerpApiSearch
15
15
 
16
- VERSION = "1.3.2"
16
+ VERSION = "2.0.0"
17
17
  BACKEND = "serpapi.com"
18
18
 
19
19
  attr_accessor :params
@@ -24,8 +24,8 @@ class SerpApiClient
24
24
  # ---
25
25
  #
26
26
  # ```ruby
27
- # require 'google_search_results'
28
- # search = SerpApiClient.new({q: "coffee", api_key: "secure API key", engine: "google"})
27
+ # require 'google_search'
28
+ # search = SerpApiSearch.new({q: "coffee", api_key: "secure API key", engine: "google"})
29
29
  # result = search.get_json
30
30
  # ```
31
31
  #
@@ -1,4 +1,4 @@
1
- require_relative 'serp_api_client'
1
+ require_relative 'serp_api_search'
2
2
 
3
3
  # Yahoo Search Result for Ruby powered by SerpApi
4
4
  #
@@ -10,7 +10,7 @@ require_relative 'serp_api_client'
10
10
  # api_key: "Your SERP API Key"
11
11
  # }
12
12
  #
13
- # search = YahooSearchResults.new(parameter)
13
+ # search = YahooSearch.new(parameter)
14
14
  # search.params[:yahoo_domain] = "fr"
15
15
  #
16
16
  # html_results = search.get_html
@@ -21,7 +21,7 @@ require_relative 'serp_api_client'
21
21
  #
22
22
  # doc: https://serpapi.com/yahoo-search-api
23
23
 
24
- class YahooSearchResults < SerpApiClient
24
+ class YahooSearch < SerpApiSearch
25
25
 
26
26
  def initialize(params = {})
27
27
  super(params, YAHOO_ENGINE)
@@ -1,4 +1,4 @@
1
- require_relative 'serp_api_client'
1
+ require_relative 'serp_api_search'
2
2
 
3
3
  # Yandex Search Result for Ruby powered by SerpApi
4
4
  #
@@ -10,7 +10,7 @@ require_relative 'serp_api_client'
10
10
  # api_key: "Your SERP API Key"
11
11
  # }
12
12
  #
13
- # search = YandexSearchResults.new(parameter)
13
+ # search = YandexSearch.new(parameter)
14
14
  # search.params[:yandex_domain] = "yandex.com"
15
15
  #
16
16
  # html_results = search.get_html
@@ -21,7 +21,7 @@ require_relative 'serp_api_client'
21
21
  #
22
22
  # doc: https://serpapi.com/yandex-search-api
23
23
 
24
- class YandexSearchResults < SerpApiClient
24
+ class YandexSearch < SerpApiSearch
25
25
 
26
26
  def initialize(params = {})
27
27
  super(params, YANDEX_ENGINE)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_search_results
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - hartator
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-05 00:00:00.000000000 Z
12
+ date: 2020-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -74,13 +74,14 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - lib/baidu_search_results.rb
78
- - lib/bing_search_results.rb
79
- - lib/ebay_search_results.rb
80
77
  - lib/google_search_results.rb
81
- - lib/serp_api_client.rb
82
- - lib/yahoo_search_results.rb
83
- - lib/yandex_search_results.rb
78
+ - lib/search/baidu_search.rb
79
+ - lib/search/bing_search.rb
80
+ - lib/search/ebay_search.rb
81
+ - lib/search/google_search.rb
82
+ - lib/search/serp_api_search.rb
83
+ - lib/search/yahoo_search.rb
84
+ - lib/search/yandex_search.rb
84
85
  homepage: https://github.com/serpapi/google-search-results-ruby
85
86
  licenses:
86
87
  - MIT