tbkapi 1.1.0 → 1.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5db772760e4074c16f6459ec71321ba9293757d
4
- data.tar.gz: 21d90f4596b72bc01d9f34d53ebcba7b80f60e86
3
+ metadata.gz: 2b1cc450b96e054a14c468036dc20405a7c0dc4c
4
+ data.tar.gz: db6a557dc1d58f83199a10ec397a58369ea20252
5
5
  SHA512:
6
- metadata.gz: cb2861b9205e4bdf46edf3b28ace5b29568f3032bc2be9bc558997cccf439c22ce3368264c3b80aaf86bb92cdb11ddaf299d5dcbe17220a0816a9bb24a3bc096
7
- data.tar.gz: b4b4bd0abc5e5247579f264683eccb6736a634d5fe0349ea16c4d9258ba93c47afe67bf309f5a51abc392d0bd763151ac685c9054376f9732852bd4befeebc5c
6
+ metadata.gz: d4f43b70529ec7b36ee038de8356f4689cde4c9558981b12866aa4e76802d109e435072008e610bf475adbfb4bca7d142450c641620d271c3ceec4f161e5a795
7
+ data.tar.gz: 2ba593d5fc52b6e5ac1f800d9485d06ec3acf1924a772539a6ea5e901c7b9796cda5f4b2a46c7ab5960a8df94bd93880a72e1924ac2899b4861a6cbc880b4469
@@ -33,6 +33,7 @@ module Tbkapi
33
33
  Net::HTTP.get(URI(TBURI + '?' + build_query(params.merge({sign: my_sign}))))
34
34
  end
35
35
 
36
+ # 只有 start_price 与 end_price 同时不为nil的时候价格筛选才生效
36
37
  def taobao_tbk_item_get_new(keyword, cat, sort, is_tmall, start_price, end_price, api_key, secret, page_no = 1, page_size = 20)
37
38
  action_params = {
38
39
  fields: "num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick",
@@ -194,6 +195,32 @@ module Tbkapi
194
195
  Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
195
196
  end
196
197
 
198
+ # 只有 start_price 与 end_price 有一个不为nil的时候价格筛选就生效
199
+ # npx_level include_pay_rate_30 include_good_rate include_rfd_rate 测试没什么效果
200
+ # start_dsr 0 - 50000
201
+ def taobao_tbk_dg_material_optional(keyword, cat, sort, is_tmall, is_overseas, has_coupon, start_dsr, start_tk_rate, end_tk_rate, start_price, end_price, material_id, api_key, secret, adzone_id, page_no = 1, page_size = 20)
202
+ action_params = {
203
+ adzone_id: adzone_id,
204
+ material_id: material_id,
205
+ page_no: page_no,
206
+ page_size: page_size
207
+ }
208
+ action_params[:q] = keyword unless keyword.nil?
209
+ action_params[:cat] = cat unless cat.nil?
210
+ action_params[:sort] = sort unless sort.nil?
211
+ action_params[:is_tmall] = is_tmall unless is_tmall.nil?
212
+ action_params[:is_overseas] = is_overseas unless is_overseas.nil?
213
+ action_params[:has_coupon] = has_coupon unless has_coupon.nil?
214
+ action_params[:start_dsr] = start_dsr unless start_dsr.nil?
215
+ action_params[:start_tk_rate] = start_tk_rate unless start_tk_rate.nil?
216
+ action_params[:end_tk_rate] = end_tk_rate unless end_tk_rate.nil?
217
+ action_params[:start_price] = start_price unless start_price.nil?
218
+ action_params[:end_price] = end_price unless end_price.nil?
219
+ params = system_params("taobao.tbk.dg.material.optional.upgrade",api_key).merge(action_params)
220
+ my_sign = get_sign(params, secret).upcase
221
+ Net::HTTP.get(URI(URI.encode((TBURI + '?' + build_query(params.merge({sign: my_sign}))))))
222
+ end
223
+
197
224
  def taobao_tbk_dg_optimus_material(adzone_id, api_key, secret, material_id = 4071, page_no = 1, page_size = 20)
198
225
  action_params = {
199
226
  adzone_id: adzone_id,
@@ -254,5 +281,25 @@ module Tbkapi
254
281
  Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
255
282
  end
256
283
 
284
+ def taobao_tbk_item_word_get(item_id, count, adzone_id, api_key, secret)
285
+ action_params = {
286
+ item_id: item_id,
287
+ adzone_id: adzone_id,
288
+ count: count
289
+ }
290
+ params = system_params("taobao.tbk.item.word.get", api_key).merge(action_params)
291
+ my_sign = get_sign(params, secret).upcase
292
+ Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
293
+ end
294
+
295
+ def taobao_tbk_spread_get(url, api_key, secret)
296
+ action_params = {
297
+ requests: [{url: url}].to_json
298
+ }
299
+ params = system_params("taobao.tbk.spread.get", api_key).merge(action_params)
300
+ my_sign = get_sign(params, secret).upcase
301
+ Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
302
+ end
303
+
257
304
  end
258
305
  end
@@ -1,3 +1,3 @@
1
1
  module Tbkapi
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tbkapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - 刘梦晨
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2024-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,7 +58,7 @@ homepage: ''
58
58
  licenses:
59
59
  - MIT
60
60
  metadata: {}
61
- post_install_message:
61
+ post_install_message:
62
62
  rdoc_options: []
63
63
  require_paths:
64
64
  - lib
@@ -73,9 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubyforge_project:
76
+ rubyforge_project:
77
77
  rubygems_version: 2.6.14
78
- signing_key:
78
+ signing_key:
79
79
  specification_version: 4
80
80
  summary: 淘宝客api ruby 调用
81
81
  test_files: []