google_search_results 1.3.0 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/baidu_search_results.rb +4 -4
- data/lib/bing_search_results.rb +5 -5
- data/lib/ebay_search_results.rb +5 -5
- data/lib/google_search_results.rb +5 -5
- data/lib/serp_api_client.rb +9 -9
- data/lib/yahoo_search_results.rb +5 -5
- data/lib/yandex_search_results.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cf8b604485ff927dae81c9fd1a5017d92563b339bc77994e0365926a14f6192
|
4
|
+
data.tar.gz: 46cca48662a2bfe6d7b7c79e34b92afa931d3be9e8cf38eb139d6d086068d2c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d26a044da90201b3c7e77841e7acc5bce8f0534ad7840df78b42120a7549ca79a3b787af90ad25e1062713b47a0fe7ab32b000a9ada008f27a64421ae97370c
|
7
|
+
data.tar.gz: 5257a57981176ee85df134f6bc89e1eebf2b16e44d0d3c90ee72a63541359b83e9ac8a69639c41c87d9f8a2eeb6571360bd223bd87b8474f90c3aa0a53b4796d
|
data/lib/baidu_search_results.rb
CHANGED
@@ -10,11 +10,11 @@ require_relative 'serp_api_client'
|
|
10
10
|
# api_key: "Serp API Key"
|
11
11
|
# }
|
12
12
|
#
|
13
|
-
#
|
13
|
+
# search = BaiduSearchResults.new(parameter)
|
14
14
|
#
|
15
|
-
# html_results =
|
16
|
-
# hash_results =
|
17
|
-
# json_results =
|
15
|
+
# html_results = search.get_html
|
16
|
+
# hash_results = search.get_hash
|
17
|
+
# json_results = search.get_json
|
18
18
|
#
|
19
19
|
# ```
|
20
20
|
# doc: https://serpapi.com/baidu-search-api
|
data/lib/bing_search_results.rb
CHANGED
@@ -11,12 +11,12 @@ require_relative '../lib/bing_search_results'
|
|
11
11
|
# api_key: "Your SERP API Key"
|
12
12
|
# }
|
13
13
|
#
|
14
|
-
#
|
15
|
-
#
|
14
|
+
# search = BingSearchResults.new(parameter)
|
15
|
+
# search.params[:location] = "Portland"
|
16
16
|
#
|
17
|
-
# html_results =
|
18
|
-
# hash_results =
|
19
|
-
# json_results =
|
17
|
+
# html_results = search.get_html
|
18
|
+
# hash_results = search.get_hash
|
19
|
+
# json_results = search.get_json
|
20
20
|
#
|
21
21
|
# ```
|
22
22
|
#
|
data/lib/ebay_search_results.rb
CHANGED
@@ -10,12 +10,12 @@ require_relative 'serp_api_client'
|
|
10
10
|
# api_key: "Your SERP API Key"
|
11
11
|
# }
|
12
12
|
#
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# search = EbaySearchResults.new(parameter)
|
14
|
+
# search.params[:ebay_domain] = "ebay.com"
|
15
15
|
#
|
16
|
-
# html_results =
|
17
|
-
# hash_results =
|
18
|
-
# json_results =
|
16
|
+
# html_results = search.get_html
|
17
|
+
# hash_results = search.get_hash
|
18
|
+
# json_results = search.get_json
|
19
19
|
#
|
20
20
|
# ```
|
21
21
|
#
|
@@ -20,12 +20,12 @@ require_relative 'serp_api_client'
|
|
20
20
|
# api_key: "Your SERP API Key"
|
21
21
|
# }
|
22
22
|
#
|
23
|
-
#
|
24
|
-
#
|
23
|
+
# search = GoogleSearchResults.new(parameter)
|
24
|
+
# search.params[:location] = "Portland"
|
25
25
|
#
|
26
|
-
# html_results =
|
27
|
-
# hash_results =
|
28
|
-
# json_results =
|
26
|
+
# html_results = search.get_html
|
27
|
+
# hash_results = search.get_hash
|
28
|
+
# json_results = search.get_json
|
29
29
|
# ```
|
30
30
|
#
|
31
31
|
# doc: https://serpapi.com/search-api
|
data/lib/serp_api_client.rb
CHANGED
@@ -9,12 +9,11 @@ YANDEX_ENGINE = 'yandex'
|
|
9
9
|
EBAY_ENGINE = 'ebay'
|
10
10
|
|
11
11
|
|
12
|
-
# Generic serpapi.com
|
13
|
-
#
|
14
|
-
# by setting the engine paremeter.
|
12
|
+
# Generic HTTP client for serpapi.com
|
13
|
+
#
|
15
14
|
class SerpApiClient
|
16
15
|
|
17
|
-
VERSION = "1.3.
|
16
|
+
VERSION = "1.3.2"
|
18
17
|
BACKEND = "serpapi.com"
|
19
18
|
|
20
19
|
attr_accessor :params
|
@@ -26,15 +25,16 @@ class SerpApiClient
|
|
26
25
|
#
|
27
26
|
# ```ruby
|
28
27
|
# require 'google_search_results'
|
29
|
-
#
|
30
|
-
# result =
|
28
|
+
# search = SerpApiClient.new({q: "coffee", api_key: "secure API key", engine: "google"})
|
29
|
+
# result = search.get_json
|
31
30
|
# ```
|
32
31
|
#
|
33
32
|
# @param [Hash] params contains requested parameter
|
34
|
-
# @param [String] engine google|baidu|google|bing|ebay|yandex
|
35
|
-
def initialize(params, engine)
|
33
|
+
# @param [String] engine google|baidu|google|bing|ebay|yandex (optional or can be set in params)
|
34
|
+
def initialize(params, engine = nil)
|
36
35
|
@params = params
|
37
36
|
@params[:engine] ||= engine
|
37
|
+
raise 'engine must be defined in params or a second argument' if @params[:engine].nil?
|
38
38
|
end
|
39
39
|
|
40
40
|
# get_json
|
@@ -117,7 +117,7 @@ class SerpApiClient
|
|
117
117
|
$serp_api_key = api_key
|
118
118
|
end
|
119
119
|
|
120
|
-
# @return [String] api_key for this
|
120
|
+
# @return [String] api_key for this search
|
121
121
|
def api_key
|
122
122
|
@params[:api_key] || @params[:serp_api_key] || $serp_api_key
|
123
123
|
end
|
data/lib/yahoo_search_results.rb
CHANGED
@@ -10,12 +10,12 @@ require_relative 'serp_api_client'
|
|
10
10
|
# api_key: "Your SERP API Key"
|
11
11
|
# }
|
12
12
|
#
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# search = YahooSearchResults.new(parameter)
|
14
|
+
# search.params[:yahoo_domain] = "fr"
|
15
15
|
#
|
16
|
-
# html_results =
|
17
|
-
# hash_results =
|
18
|
-
# json_results =
|
16
|
+
# html_results = search.get_html
|
17
|
+
# hash_results = search.get_hash
|
18
|
+
# json_results = search.get_json
|
19
19
|
#
|
20
20
|
# ```
|
21
21
|
#
|
@@ -10,12 +10,12 @@ require_relative 'serp_api_client'
|
|
10
10
|
# api_key: "Your SERP API Key"
|
11
11
|
# }
|
12
12
|
#
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# search = YandexSearchResults.new(parameter)
|
14
|
+
# search.params[:yandex_domain] = "yandex.com"
|
15
15
|
#
|
16
|
-
# html_results =
|
17
|
-
# hash_results =
|
18
|
-
# json_results =
|
16
|
+
# html_results = search.get_html
|
17
|
+
# hash_results = search.get_hash
|
18
|
+
# json_results = search.get_json
|
19
19
|
#
|
20
20
|
# ```
|
21
21
|
#
|
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.
|
4
|
+
version: 1.3.2
|
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-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.49.1
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.49.1
|
70
70
|
description: Scape localized search results from search engine using SerpApi.com and
|
71
71
|
returns Hash, JSON, raw HTML
|
72
72
|
email: hartator@gmail.com
|