scrapebadger 0.1.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 +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +548 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +76 -0
- data/docs/AccountInfo.md +28 -0
- data/docs/AmazonApi.md +1244 -0
- data/docs/ApartmentsApi.md +373 -0
- data/docs/BaiduApi.md +447 -0
- data/docs/BillingLogListResponse.md +24 -0
- data/docs/BillingLogResponse.md +32 -0
- data/docs/BingApi.md +610 -0
- data/docs/ChatGPTApi.md +521 -0
- data/docs/DepopApi.md +542 -0
- data/docs/DuckDuckGoApi.md +700 -0
- data/docs/EBayApi.md +1019 -0
- data/docs/FacebookApi.md +1671 -0
- data/docs/FilterRuleCreate.md +28 -0
- data/docs/FilterRuleDeliveryLogListResponse.md +24 -0
- data/docs/FilterRuleDeliveryLogResponse.md +44 -0
- data/docs/FilterRuleListResponse.md +24 -0
- data/docs/FilterRuleResponse.md +40 -0
- data/docs/FilterRuleUpdate.md +30 -0
- data/docs/FilterRuleValidateRequest.md +18 -0
- data/docs/FilterRuleValidateResponse.md +22 -0
- data/docs/GoogleApi.md +3175 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/IdealistaApi.md +822 -0
- data/docs/ImmobiliareApi.md +773 -0
- data/docs/InstagramApi.md +1673 -0
- data/docs/LeboncoinApi.md +884 -0
- data/docs/LinkedInApi.md +925 -0
- data/docs/LoopNetApi.md +529 -0
- data/docs/PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse.md +20 -0
- data/docs/RealtorApi.md +474 -0
- data/docs/RedditApi.md +1677 -0
- data/docs/RedfinApi.md +616 -0
- data/docs/StreamMonitorCreate.md +26 -0
- data/docs/StreamMonitorListResponse.md +24 -0
- data/docs/StreamMonitorResponse.md +42 -0
- data/docs/StreamMonitorUpdate.md +28 -0
- data/docs/SubscriptionInfo.md +40 -0
- data/docs/TikTokApi.md +2104 -0
- data/docs/TweetDeliveryLogListResponse.md +24 -0
- data/docs/TweetDeliveryLogResponse.md +44 -0
- data/docs/TwitterApi.md +4091 -0
- data/docs/ValidationError.md +22 -0
- data/docs/ValidationErrorLocInner.md +15 -0
- data/docs/VintedApi.md +766 -0
- data/docs/WalmartApi.md +904 -0
- data/docs/WebApi.md +634 -0
- data/docs/WebhookCreate.md +22 -0
- data/docs/WebhookListItem.md +28 -0
- data/docs/WebhookListResponse.md +20 -0
- data/docs/WebhookResponse.md +26 -0
- data/docs/WebhookTestRequest.md +18 -0
- data/docs/WebhookTestResponse.md +24 -0
- data/docs/YahooApi.md +602 -0
- data/docs/YandexApi.md +450 -0
- data/docs/YouTubeApi.md +2872 -0
- data/docs/ZillowApi.md +622 -0
- data/git_push.sh +57 -0
- data/lib/scrapebadger/api/account_api.rb +79 -0
- data/lib/scrapebadger/api/amazon_api.rb +1165 -0
- data/lib/scrapebadger/api/apartments_api.rb +377 -0
- data/lib/scrapebadger/api/baidu_api.rb +436 -0
- data/lib/scrapebadger/api/bing_api.rb +580 -0
- data/lib/scrapebadger/api/chat_gpt_api.rb +466 -0
- data/lib/scrapebadger/api/depop_api.rb +518 -0
- data/lib/scrapebadger/api/duck_duck_go_api.rb +675 -0
- data/lib/scrapebadger/api/e_bay_api.rb +1029 -0
- data/lib/scrapebadger/api/facebook_api.rb +1492 -0
- data/lib/scrapebadger/api/google_api.rb +3191 -0
- data/lib/scrapebadger/api/idealista_api.rb +864 -0
- data/lib/scrapebadger/api/immobiliare_api.rb +734 -0
- data/lib/scrapebadger/api/instagram_api.rb +1555 -0
- data/lib/scrapebadger/api/leboncoin_api.rb +818 -0
- data/lib/scrapebadger/api/linked_in_api.rb +832 -0
- data/lib/scrapebadger/api/loop_net_api.rb +503 -0
- data/lib/scrapebadger/api/realtor_api.rb +481 -0
- data/lib/scrapebadger/api/reddit_api.rb +1601 -0
- data/lib/scrapebadger/api/redfin_api.rb +625 -0
- data/lib/scrapebadger/api/tik_tok_api.rb +2029 -0
- data/lib/scrapebadger/api/twitter_api.rb +3696 -0
- data/lib/scrapebadger/api/vinted_api.rb +705 -0
- data/lib/scrapebadger/api/walmart_api.rb +876 -0
- data/lib/scrapebadger/api/web_api.rb +547 -0
- data/lib/scrapebadger/api/yahoo_api.rb +560 -0
- data/lib/scrapebadger/api/yandex_api.rb +422 -0
- data/lib/scrapebadger/api/you_tube_api.rb +2520 -0
- data/lib/scrapebadger/api/zillow_api.rb +634 -0
- data/lib/scrapebadger/api_client.rb +394 -0
- data/lib/scrapebadger/api_error.rb +58 -0
- data/lib/scrapebadger/configuration.rb +308 -0
- data/lib/scrapebadger/models/account_info.rb +288 -0
- data/lib/scrapebadger/models/billing_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/billing_log_response.rb +334 -0
- data/lib/scrapebadger/models/filter_rule_create.rb +427 -0
- data/lib/scrapebadger/models/filter_rule_delivery_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/filter_rule_delivery_log_response.rb +422 -0
- data/lib/scrapebadger/models/filter_rule_list_response.rb +272 -0
- data/lib/scrapebadger/models/filter_rule_response.rb +390 -0
- data/lib/scrapebadger/models/filter_rule_update.rb +389 -0
- data/lib/scrapebadger/models/filter_rule_validate_request.rb +250 -0
- data/lib/scrapebadger/models/filter_rule_validate_response.rb +248 -0
- data/lib/scrapebadger/models/http_validation_error.rb +216 -0
- data/lib/scrapebadger/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response.rb +238 -0
- data/lib/scrapebadger/models/stream_monitor_create.rb +373 -0
- data/lib/scrapebadger/models/stream_monitor_list_response.rb +272 -0
- data/lib/scrapebadger/models/stream_monitor_response.rb +406 -0
- data/lib/scrapebadger/models/stream_monitor_update.rb +335 -0
- data/lib/scrapebadger/models/subscription_info.rb +352 -0
- data/lib/scrapebadger/models/tweet_delivery_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/tweet_delivery_log_response.rb +422 -0
- data/lib/scrapebadger/models/validation_error.rb +255 -0
- data/lib/scrapebadger/models/validation_error_loc_inner.rb +104 -0
- data/lib/scrapebadger/models/webhook_create.rb +282 -0
- data/lib/scrapebadger/models/webhook_list_item.rb +302 -0
- data/lib/scrapebadger/models/webhook_list_response.rb +240 -0
- data/lib/scrapebadger/models/webhook_response.rb +286 -0
- data/lib/scrapebadger/models/webhook_test_request.rb +223 -0
- data/lib/scrapebadger/models/webhook_test_response.rb +259 -0
- data/lib/scrapebadger/version.rb +15 -0
- data/lib/scrapebadger.rb +96 -0
- data/scrapebadger.gemspec +39 -0
- data/spec/api/account_api_spec.rb +46 -0
- data/spec/api/amazon_api_spec.rb +258 -0
- data/spec/api/apartments_api_spec.rb +98 -0
- data/spec/api/baidu_api_spec.rb +109 -0
- data/spec/api/bing_api_spec.rb +141 -0
- data/spec/api/chat_gpt_api_spec.rb +123 -0
- data/spec/api/depop_api_spec.rb +132 -0
- data/spec/api/duck_duck_go_api_spec.rb +162 -0
- data/spec/api/e_bay_api_spec.rb +222 -0
- data/spec/api/facebook_api_spec.rb +326 -0
- data/spec/api/google_api_spec.rb +649 -0
- data/spec/api/idealista_api_spec.rb +197 -0
- data/spec/api/immobiliare_api_spec.rb +174 -0
- data/spec/api/instagram_api_spec.rb +309 -0
- data/spec/api/leboncoin_api_spec.rb +184 -0
- data/spec/api/linked_in_api_spec.rb +197 -0
- data/spec/api/loop_net_api_spec.rb +127 -0
- data/spec/api/realtor_api_spec.rb +123 -0
- data/spec/api/reddit_api_spec.rb +331 -0
- data/spec/api/redfin_api_spec.rb +147 -0
- data/spec/api/tik_tok_api_spec.rb +413 -0
- data/spec/api/twitter_api_spec.rb +735 -0
- data/spec/api/vinted_api_spec.rb +169 -0
- data/spec/api/walmart_api_spec.rb +192 -0
- data/spec/api/web_api_spec.rb +136 -0
- data/spec/api/yahoo_api_spec.rb +137 -0
- data/spec/api/yandex_api_spec.rb +111 -0
- data/spec/api/you_tube_api_spec.rb +500 -0
- data/spec/api/zillow_api_spec.rb +150 -0
- data/spec/models/account_info_spec.rb +66 -0
- data/spec/models/billing_log_list_response_spec.rb +54 -0
- data/spec/models/billing_log_response_spec.rb +78 -0
- data/spec/models/filter_rule_create_spec.rb +66 -0
- data/spec/models/filter_rule_delivery_log_list_response_spec.rb +54 -0
- data/spec/models/filter_rule_delivery_log_response_spec.rb +114 -0
- data/spec/models/filter_rule_list_response_spec.rb +54 -0
- data/spec/models/filter_rule_response_spec.rb +102 -0
- data/spec/models/filter_rule_update_spec.rb +72 -0
- data/spec/models/filter_rule_validate_request_spec.rb +36 -0
- data/spec/models/filter_rule_validate_response_spec.rb +48 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response_spec.rb +42 -0
- data/spec/models/stream_monitor_create_spec.rb +60 -0
- data/spec/models/stream_monitor_list_response_spec.rb +54 -0
- data/spec/models/stream_monitor_response_spec.rb +108 -0
- data/spec/models/stream_monitor_update_spec.rb +66 -0
- data/spec/models/subscription_info_spec.rb +102 -0
- data/spec/models/tweet_delivery_log_list_response_spec.rb +54 -0
- data/spec/models/tweet_delivery_log_response_spec.rb +114 -0
- data/spec/models/validation_error_loc_inner_spec.rb +21 -0
- data/spec/models/validation_error_spec.rb +48 -0
- data/spec/models/webhook_create_spec.rb +48 -0
- data/spec/models/webhook_list_item_spec.rb +66 -0
- data/spec/models/webhook_list_response_spec.rb +42 -0
- data/spec/models/webhook_response_spec.rb +60 -0
- data/spec/models/webhook_test_request_spec.rb +36 -0
- data/spec/models/webhook_test_response_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +324 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ScrapeBadger API
|
|
3
|
+
|
|
4
|
+
#Unified credit-based scraping API. https://docs.scrapebadger.com
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module ScrapeBadger
|
|
16
|
+
class BaiduApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Baidu image search
|
|
23
|
+
# Baidu image search via the acjson JSON API.
|
|
24
|
+
# @param query [String] Search keywords
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [Integer] :page 30 images per page (default to 1)
|
|
27
|
+
# @return [Object]
|
|
28
|
+
def baidu_baidu_image_search(query, opts = {})
|
|
29
|
+
data, _status_code, _headers = baidu_baidu_image_search_with_http_info(query, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Baidu image search
|
|
34
|
+
# Baidu image search via the acjson JSON API.
|
|
35
|
+
# @param query [String] Search keywords
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [Integer] :page 30 images per page (default to 1)
|
|
38
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
39
|
+
def baidu_baidu_image_search_with_http_info(query, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: BaiduApi.baidu_baidu_image_search ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'query' is set
|
|
44
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BaiduApi.baidu_baidu_image_search"
|
|
46
|
+
end
|
|
47
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 50
|
|
48
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BaiduApi.baidu_baidu_image_search, must be smaller than or equal to 50.'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
52
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BaiduApi.baidu_baidu_image_search, must be greater than or equal to 1.'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# resource path
|
|
56
|
+
local_var_path = '/v1/baidu/images'
|
|
57
|
+
|
|
58
|
+
# query parameters
|
|
59
|
+
query_params = opts[:query_params] || {}
|
|
60
|
+
query_params[:'query'] = query
|
|
61
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
62
|
+
|
|
63
|
+
# header parameters
|
|
64
|
+
header_params = opts[:header_params] || {}
|
|
65
|
+
# HTTP header 'Accept' (if needed)
|
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
67
|
+
|
|
68
|
+
# form parameters
|
|
69
|
+
form_params = opts[:form_params] || {}
|
|
70
|
+
|
|
71
|
+
# http body (model)
|
|
72
|
+
post_body = opts[:debug_body]
|
|
73
|
+
|
|
74
|
+
# return_type
|
|
75
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
76
|
+
|
|
77
|
+
# auth_names
|
|
78
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
79
|
+
|
|
80
|
+
new_options = opts.merge(
|
|
81
|
+
:operation => :"BaiduApi.baidu_baidu_image_search",
|
|
82
|
+
:header_params => header_params,
|
|
83
|
+
:query_params => query_params,
|
|
84
|
+
:form_params => form_params,
|
|
85
|
+
:body => post_body,
|
|
86
|
+
:auth_names => auth_names,
|
|
87
|
+
:return_type => return_type
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
91
|
+
if @api_client.config.debugging
|
|
92
|
+
@api_client.config.logger.debug "API called: BaiduApi#baidu_baidu_image_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
93
|
+
end
|
|
94
|
+
return data, status_code, headers
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Baidu news search
|
|
98
|
+
# Baidu news vertical — articles with source, publish date and real URLs.
|
|
99
|
+
# @param query [String] Search keywords
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @option opts [Integer] :page (default to 1)
|
|
102
|
+
# @return [Object]
|
|
103
|
+
def baidu_baidu_news_search(query, opts = {})
|
|
104
|
+
data, _status_code, _headers = baidu_baidu_news_search_with_http_info(query, opts)
|
|
105
|
+
data
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Baidu news search
|
|
109
|
+
# Baidu news vertical — articles with source, publish date and real URLs.
|
|
110
|
+
# @param query [String] Search keywords
|
|
111
|
+
# @param [Hash] opts the optional parameters
|
|
112
|
+
# @option opts [Integer] :page (default to 1)
|
|
113
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
114
|
+
def baidu_baidu_news_search_with_http_info(query, opts = {})
|
|
115
|
+
if @api_client.config.debugging
|
|
116
|
+
@api_client.config.logger.debug 'Calling API: BaiduApi.baidu_baidu_news_search ...'
|
|
117
|
+
end
|
|
118
|
+
# verify the required parameter 'query' is set
|
|
119
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
120
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BaiduApi.baidu_baidu_news_search"
|
|
121
|
+
end
|
|
122
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 76
|
|
123
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BaiduApi.baidu_baidu_news_search, must be smaller than or equal to 76.'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
127
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BaiduApi.baidu_baidu_news_search, must be greater than or equal to 1.'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# resource path
|
|
131
|
+
local_var_path = '/v1/baidu/news'
|
|
132
|
+
|
|
133
|
+
# query parameters
|
|
134
|
+
query_params = opts[:query_params] || {}
|
|
135
|
+
query_params[:'query'] = query
|
|
136
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
137
|
+
|
|
138
|
+
# header parameters
|
|
139
|
+
header_params = opts[:header_params] || {}
|
|
140
|
+
# HTTP header 'Accept' (if needed)
|
|
141
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
142
|
+
|
|
143
|
+
# form parameters
|
|
144
|
+
form_params = opts[:form_params] || {}
|
|
145
|
+
|
|
146
|
+
# http body (model)
|
|
147
|
+
post_body = opts[:debug_body]
|
|
148
|
+
|
|
149
|
+
# return_type
|
|
150
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
151
|
+
|
|
152
|
+
# auth_names
|
|
153
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
154
|
+
|
|
155
|
+
new_options = opts.merge(
|
|
156
|
+
:operation => :"BaiduApi.baidu_baidu_news_search",
|
|
157
|
+
:header_params => header_params,
|
|
158
|
+
:query_params => query_params,
|
|
159
|
+
:form_params => form_params,
|
|
160
|
+
:body => post_body,
|
|
161
|
+
:auth_names => auth_names,
|
|
162
|
+
:return_type => return_type
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
166
|
+
if @api_client.config.debugging
|
|
167
|
+
@api_client.config.logger.debug "API called: BaiduApi#baidu_baidu_news_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
168
|
+
end
|
|
169
|
+
return data, status_code, headers
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Baidu scraper health check
|
|
173
|
+
# Check health of the Baidu scraper service (accepts HEAD for UptimeRobot).
|
|
174
|
+
# @param [Hash] opts the optional parameters
|
|
175
|
+
# @return [Object]
|
|
176
|
+
def baidu_baidu_scraper_health_check(opts = {})
|
|
177
|
+
data, _status_code, _headers = baidu_baidu_scraper_health_check_with_http_info(opts)
|
|
178
|
+
data
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Baidu scraper health check
|
|
182
|
+
# Check health of the Baidu scraper service (accepts HEAD for UptimeRobot).
|
|
183
|
+
# @param [Hash] opts the optional parameters
|
|
184
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
185
|
+
def baidu_baidu_scraper_health_check_with_http_info(opts = {})
|
|
186
|
+
if @api_client.config.debugging
|
|
187
|
+
@api_client.config.logger.debug 'Calling API: BaiduApi.baidu_baidu_scraper_health_check ...'
|
|
188
|
+
end
|
|
189
|
+
# resource path
|
|
190
|
+
local_var_path = '/v1/baidu/health'
|
|
191
|
+
|
|
192
|
+
# query parameters
|
|
193
|
+
query_params = opts[:query_params] || {}
|
|
194
|
+
|
|
195
|
+
# header parameters
|
|
196
|
+
header_params = opts[:header_params] || {}
|
|
197
|
+
# HTTP header 'Accept' (if needed)
|
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
199
|
+
|
|
200
|
+
# form parameters
|
|
201
|
+
form_params = opts[:form_params] || {}
|
|
202
|
+
|
|
203
|
+
# http body (model)
|
|
204
|
+
post_body = opts[:debug_body]
|
|
205
|
+
|
|
206
|
+
# return_type
|
|
207
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
208
|
+
|
|
209
|
+
# auth_names
|
|
210
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
211
|
+
|
|
212
|
+
new_options = opts.merge(
|
|
213
|
+
:operation => :"BaiduApi.baidu_baidu_scraper_health_check",
|
|
214
|
+
:header_params => header_params,
|
|
215
|
+
:query_params => query_params,
|
|
216
|
+
:form_params => form_params,
|
|
217
|
+
:body => post_body,
|
|
218
|
+
:auth_names => auth_names,
|
|
219
|
+
:return_type => return_type
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
223
|
+
if @api_client.config.debugging
|
|
224
|
+
@api_client.config.logger.debug "API called: BaiduApi#baidu_baidu_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
225
|
+
end
|
|
226
|
+
return data, status_code, headers
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Baidu scraper health check
|
|
230
|
+
# Check health of the Baidu scraper service (accepts HEAD for UptimeRobot).
|
|
231
|
+
# @param [Hash] opts the optional parameters
|
|
232
|
+
# @return [Object]
|
|
233
|
+
def baidu_baidu_scraper_health_check_head(opts = {})
|
|
234
|
+
data, _status_code, _headers = baidu_baidu_scraper_health_check_head_with_http_info(opts)
|
|
235
|
+
data
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Baidu scraper health check
|
|
239
|
+
# Check health of the Baidu scraper service (accepts HEAD for UptimeRobot).
|
|
240
|
+
# @param [Hash] opts the optional parameters
|
|
241
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
242
|
+
def baidu_baidu_scraper_health_check_head_with_http_info(opts = {})
|
|
243
|
+
if @api_client.config.debugging
|
|
244
|
+
@api_client.config.logger.debug 'Calling API: BaiduApi.baidu_baidu_scraper_health_check_head ...'
|
|
245
|
+
end
|
|
246
|
+
# resource path
|
|
247
|
+
local_var_path = '/v1/baidu/health'
|
|
248
|
+
|
|
249
|
+
# query parameters
|
|
250
|
+
query_params = opts[:query_params] || {}
|
|
251
|
+
|
|
252
|
+
# header parameters
|
|
253
|
+
header_params = opts[:header_params] || {}
|
|
254
|
+
# HTTP header 'Accept' (if needed)
|
|
255
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
256
|
+
|
|
257
|
+
# form parameters
|
|
258
|
+
form_params = opts[:form_params] || {}
|
|
259
|
+
|
|
260
|
+
# http body (model)
|
|
261
|
+
post_body = opts[:debug_body]
|
|
262
|
+
|
|
263
|
+
# return_type
|
|
264
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
265
|
+
|
|
266
|
+
# auth_names
|
|
267
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
268
|
+
|
|
269
|
+
new_options = opts.merge(
|
|
270
|
+
:operation => :"BaiduApi.baidu_baidu_scraper_health_check_head",
|
|
271
|
+
:header_params => header_params,
|
|
272
|
+
:query_params => query_params,
|
|
273
|
+
:form_params => form_params,
|
|
274
|
+
:body => post_body,
|
|
275
|
+
:auth_names => auth_names,
|
|
276
|
+
:return_type => return_type
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
|
|
280
|
+
if @api_client.config.debugging
|
|
281
|
+
@api_client.config.logger.debug "API called: BaiduApi#baidu_baidu_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
282
|
+
end
|
|
283
|
+
return data, status_code, headers
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Baidu web search
|
|
287
|
+
# Baidu web SERP — organic results with real target URLs, related searches, total count.
|
|
288
|
+
# @param query [String] Search keywords, e.g. '咖啡机' or 'coffee machine'
|
|
289
|
+
# @param [Hash] opts the optional parameters
|
|
290
|
+
# @option opts [Integer] :page Result page (10 results per page) (default to 1)
|
|
291
|
+
# @option opts [Integer] :num Results per page (rn) (default to 10)
|
|
292
|
+
# @return [Object]
|
|
293
|
+
def baidu_baidu_web_search(query, opts = {})
|
|
294
|
+
data, _status_code, _headers = baidu_baidu_web_search_with_http_info(query, opts)
|
|
295
|
+
data
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Baidu web search
|
|
299
|
+
# Baidu web SERP — organic results with real target URLs, related searches, total count.
|
|
300
|
+
# @param query [String] Search keywords, e.g. '咖啡机' or 'coffee machine'
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @option opts [Integer] :page Result page (10 results per page) (default to 1)
|
|
303
|
+
# @option opts [Integer] :num Results per page (rn) (default to 10)
|
|
304
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
305
|
+
def baidu_baidu_web_search_with_http_info(query, opts = {})
|
|
306
|
+
if @api_client.config.debugging
|
|
307
|
+
@api_client.config.logger.debug 'Calling API: BaiduApi.baidu_baidu_web_search ...'
|
|
308
|
+
end
|
|
309
|
+
# verify the required parameter 'query' is set
|
|
310
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
311
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BaiduApi.baidu_baidu_web_search"
|
|
312
|
+
end
|
|
313
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 76
|
|
314
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BaiduApi.baidu_baidu_web_search, must be smaller than or equal to 76.'
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
318
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling BaiduApi.baidu_baidu_web_search, must be greater than or equal to 1.'
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
if @api_client.config.client_side_validation && !opts[:'num'].nil? && opts[:'num'] > 50
|
|
322
|
+
fail ArgumentError, 'invalid value for "opts[:"num"]" when calling BaiduApi.baidu_baidu_web_search, must be smaller than or equal to 50.'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
if @api_client.config.client_side_validation && !opts[:'num'].nil? && opts[:'num'] < 1
|
|
326
|
+
fail ArgumentError, 'invalid value for "opts[:"num"]" when calling BaiduApi.baidu_baidu_web_search, must be greater than or equal to 1.'
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# resource path
|
|
330
|
+
local_var_path = '/v1/baidu/search'
|
|
331
|
+
|
|
332
|
+
# query parameters
|
|
333
|
+
query_params = opts[:query_params] || {}
|
|
334
|
+
query_params[:'query'] = query
|
|
335
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
336
|
+
query_params[:'num'] = opts[:'num'] if !opts[:'num'].nil?
|
|
337
|
+
|
|
338
|
+
# header parameters
|
|
339
|
+
header_params = opts[:header_params] || {}
|
|
340
|
+
# HTTP header 'Accept' (if needed)
|
|
341
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
342
|
+
|
|
343
|
+
# form parameters
|
|
344
|
+
form_params = opts[:form_params] || {}
|
|
345
|
+
|
|
346
|
+
# http body (model)
|
|
347
|
+
post_body = opts[:debug_body]
|
|
348
|
+
|
|
349
|
+
# return_type
|
|
350
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
351
|
+
|
|
352
|
+
# auth_names
|
|
353
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
354
|
+
|
|
355
|
+
new_options = opts.merge(
|
|
356
|
+
:operation => :"BaiduApi.baidu_baidu_web_search",
|
|
357
|
+
:header_params => header_params,
|
|
358
|
+
:query_params => query_params,
|
|
359
|
+
:form_params => form_params,
|
|
360
|
+
:body => post_body,
|
|
361
|
+
:auth_names => auth_names,
|
|
362
|
+
:return_type => return_type
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
366
|
+
if @api_client.config.debugging
|
|
367
|
+
@api_client.config.logger.debug "API called: BaiduApi#baidu_baidu_web_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
368
|
+
end
|
|
369
|
+
return data, status_code, headers
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# Search suggestions
|
|
373
|
+
# Baidu search-box suggestions.
|
|
374
|
+
# @param query [String] Partial search term, e.g. '咖啡' or 'coff'
|
|
375
|
+
# @param [Hash] opts the optional parameters
|
|
376
|
+
# @return [Object]
|
|
377
|
+
def baidu_search_suggestions(query, opts = {})
|
|
378
|
+
data, _status_code, _headers = baidu_search_suggestions_with_http_info(query, opts)
|
|
379
|
+
data
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
# Search suggestions
|
|
383
|
+
# Baidu search-box suggestions.
|
|
384
|
+
# @param query [String] Partial search term, e.g. '咖啡' or 'coff'
|
|
385
|
+
# @param [Hash] opts the optional parameters
|
|
386
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
387
|
+
def baidu_search_suggestions_with_http_info(query, opts = {})
|
|
388
|
+
if @api_client.config.debugging
|
|
389
|
+
@api_client.config.logger.debug 'Calling API: BaiduApi.baidu_search_suggestions ...'
|
|
390
|
+
end
|
|
391
|
+
# verify the required parameter 'query' is set
|
|
392
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
393
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BaiduApi.baidu_search_suggestions"
|
|
394
|
+
end
|
|
395
|
+
# resource path
|
|
396
|
+
local_var_path = '/v1/baidu/autocomplete'
|
|
397
|
+
|
|
398
|
+
# query parameters
|
|
399
|
+
query_params = opts[:query_params] || {}
|
|
400
|
+
query_params[:'query'] = query
|
|
401
|
+
|
|
402
|
+
# header parameters
|
|
403
|
+
header_params = opts[:header_params] || {}
|
|
404
|
+
# HTTP header 'Accept' (if needed)
|
|
405
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
406
|
+
|
|
407
|
+
# form parameters
|
|
408
|
+
form_params = opts[:form_params] || {}
|
|
409
|
+
|
|
410
|
+
# http body (model)
|
|
411
|
+
post_body = opts[:debug_body]
|
|
412
|
+
|
|
413
|
+
# return_type
|
|
414
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
415
|
+
|
|
416
|
+
# auth_names
|
|
417
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
418
|
+
|
|
419
|
+
new_options = opts.merge(
|
|
420
|
+
:operation => :"BaiduApi.baidu_search_suggestions",
|
|
421
|
+
:header_params => header_params,
|
|
422
|
+
:query_params => query_params,
|
|
423
|
+
:form_params => form_params,
|
|
424
|
+
:body => post_body,
|
|
425
|
+
:auth_names => auth_names,
|
|
426
|
+
:return_type => return_type
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
430
|
+
if @api_client.config.debugging
|
|
431
|
+
@api_client.config.logger.debug "API called: BaiduApi#baidu_search_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
432
|
+
end
|
|
433
|
+
return data, status_code, headers
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
end
|