google_search_results 1.3.2 → 2.0.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.
- checksums.yaml +4 -4
- data/lib/google_search_results.rb +7 -39
- data/lib/{baidu_search_results.rb → search/baidu_search.rb} +3 -3
- data/lib/{bing_search_results.rb → search/bing_search.rb} +3 -3
- data/lib/{ebay_search_results.rb → search/ebay_search.rb} +3 -3
- data/lib/search/google_search.rb +39 -0
- data/lib/{serp_api_client.rb → search/serp_api_search.rb} +4 -4
- data/lib/{yahoo_search_results.rb → search/yahoo_search.rb} +3 -3
- data/lib/{yandex_search_results.rb → search/yandex_search.rb} +3 -3
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6431b13d508a7d2758723df6ff4f0f702e00005daf957789b01f993516e4a37
|
4
|
+
data.tar.gz: 8ade7cedec4cfeb413ee4f5ded86ba37a578f5424f88f5ab28bcec9006623983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 112a0060aa508a73274f6b96233ec46a7d4256d2d3e5952605a1951da9b8af0225b6f1be61e5fc8d7c149feff52218538a3cb39221fc305d09ed8f387fbf2385
|
7
|
+
data.tar.gz: e9d03804d47bd7e84778635e4cf35b14790cad13124572bf23a769a7160b68f26381d42532b15a4a28033ee69f8be1d8fa11c18b252937631a4342d3c5e514ce
|
@@ -1,39 +1,7 @@
|
|
1
|
-
require_relative '
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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 '
|
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 =
|
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
|
22
|
+
class BaiduSearch < SerpApiSearch
|
23
23
|
|
24
24
|
def initialize(params = {})
|
25
25
|
super(params, BING_ENGINE)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
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 =
|
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
|
25
|
+
class BingSearch < SerpApiSearch
|
26
26
|
|
27
27
|
def initialize(params = {})
|
28
28
|
super(params, BING_ENGINE)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
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 =
|
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
|
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
|
14
|
+
class SerpApiSearch
|
15
15
|
|
16
|
-
VERSION = "
|
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 '
|
28
|
-
# search =
|
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 '
|
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 =
|
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
|
24
|
+
class YahooSearch < SerpApiSearch
|
25
25
|
|
26
26
|
def initialize(params = {})
|
27
27
|
super(params, YAHOO_ENGINE)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '
|
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 =
|
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
|
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:
|
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-
|
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/
|
82
|
-
- lib/
|
83
|
-
- lib/
|
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
|