tbkapi 1.0.4 → 1.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 +4 -4
- data/lib/tbkapi/api_taobaoke.rb +81 -1
- data/lib/tbkapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5db772760e4074c16f6459ec71321ba9293757d
|
4
|
+
data.tar.gz: 21d90f4596b72bc01d9f34d53ebcba7b80f60e86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb2861b9205e4bdf46edf3b28ace5b29568f3032bc2be9bc558997cccf439c22ce3368264c3b80aaf86bb92cdb11ddaf299d5dcbe17220a0816a9bb24a3bc096
|
7
|
+
data.tar.gz: b4b4bd0abc5e5247579f264683eccb6736a634d5fe0349ea16c4d9258ba93c47afe67bf309f5a51abc392d0bd763151ac685c9054376f9732852bd4befeebc5c
|
data/lib/tbkapi/api_taobaoke.rb
CHANGED
@@ -33,7 +33,22 @@ module Tbkapi
|
|
33
33
|
Net::HTTP.get(URI(TBURI + '?' + build_query(params.merge({sign: my_sign}))))
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
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
|
+
action_params = {
|
38
|
+
fields: "num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick",
|
39
|
+
page_no: page_no,
|
40
|
+
page_size: page_size
|
41
|
+
}
|
42
|
+
action_params[:q] = keyword unless keyword.nil?
|
43
|
+
action_params[:cat] = cat unless cat.nil?
|
44
|
+
action_params[:sort] = sort unless sort.nil?
|
45
|
+
action_params[:is_tmall] = is_tmall unless is_tmall.nil?
|
46
|
+
action_params[:start_price] = start_price unless start_price.nil?
|
47
|
+
action_params[:end_price] = end_price unless end_price.nil?
|
48
|
+
params = system_params("taobao.tbk.item.get",api_key).merge(action_params)
|
49
|
+
my_sign = get_sign(params, secret).upcase
|
50
|
+
Net::HTTP.get(URI(URI.encode((TBURI + '?' + build_query(params.merge({sign: my_sign}))))))
|
51
|
+
end
|
37
52
|
|
38
53
|
def taobao_tbk_item_get(keyword, api_key, secret, page_no = 1, page_size = 20)
|
39
54
|
action_params = {
|
@@ -102,6 +117,22 @@ module Tbkapi
|
|
102
117
|
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
103
118
|
end
|
104
119
|
|
120
|
+
def taobao_tbk_shop_get_new(q, api_key, secret, is_tmall = false, start_credit = 1, end_credit = 20, page_no = 1, page_size= 20)
|
121
|
+
action_params ={
|
122
|
+
fields: "user_id,shop_title,shop_type,seller_nick,pict_url,shop_url",
|
123
|
+
q: q,
|
124
|
+
is_tmall: is_tmall,
|
125
|
+
start_credit: start_credit,
|
126
|
+
end_credit: end_credit,
|
127
|
+
page_no: page_no,
|
128
|
+
page_size: page_size,
|
129
|
+
sort: "total_auction_des"
|
130
|
+
}
|
131
|
+
params = system_params("taobao.tbk.shop.get",api_key).merge(action_params)
|
132
|
+
my_sign = get_sign(params, secret).upcase
|
133
|
+
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
134
|
+
end
|
135
|
+
|
105
136
|
def taobao_ju_items_search(q, pid, api_key, secret)
|
106
137
|
action_params ={
|
107
138
|
param_top_item_query: {
|
@@ -174,5 +205,54 @@ module Tbkapi
|
|
174
205
|
my_sign = get_sign(params, secret).upcase
|
175
206
|
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
176
207
|
end
|
208
|
+
|
209
|
+
def taobao_tbk_content_get(adzone_id, api_key, secret, type, before_time, count, cid, content_set)
|
210
|
+
action_params = {
|
211
|
+
adzone_id: adzone_id
|
212
|
+
}
|
213
|
+
action_params[:type] = type if type && type > 0
|
214
|
+
action_params[:before_timestamp] = before_time if before_time && before_time > 0
|
215
|
+
action_params[:count] = count if count && count > 0
|
216
|
+
action_params[:cid] = cid if cid && cid > 0
|
217
|
+
action_params[:content_set] = content_set if content_set && content_set > 0
|
218
|
+
|
219
|
+
params = system_params("taobao.tbk.content.get", api_key).merge(action_params)
|
220
|
+
my_sign = get_sign(params, secret).upcase
|
221
|
+
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
222
|
+
end
|
223
|
+
|
224
|
+
def taobao_tbk_shop_convert(adzone_id, api_key, secret, shop_id)
|
225
|
+
action_params = {
|
226
|
+
adzone_id: adzone_id,
|
227
|
+
fields: "user_id,click_url",
|
228
|
+
user_ids: shop_id
|
229
|
+
}
|
230
|
+
params = system_params("taobao.tbk.shop.convert", api_key).merge(action_params)
|
231
|
+
my_sign = get_sign(params, secret).upcase
|
232
|
+
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
233
|
+
end
|
234
|
+
|
235
|
+
def taobao_tbk_item_convert(adzone_id, api_key, secret, item_id)
|
236
|
+
action_params = {
|
237
|
+
adzone_id: adzone_id,
|
238
|
+
fields: "num_iid,click_url",
|
239
|
+
num_iids: item_id
|
240
|
+
}
|
241
|
+
params = system_params("taobao.tbk.item.convert", api_key).merge(action_params)
|
242
|
+
my_sign = get_sign(params, secret).upcase
|
243
|
+
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
244
|
+
end
|
245
|
+
|
246
|
+
def taobao_itemcats_get(parent_cid, cids, api_key, secret)
|
247
|
+
action_params = {
|
248
|
+
parent_cid: parent_cid,
|
249
|
+
fields: "cid,parent_cid,name,is_parent",
|
250
|
+
cids: cids
|
251
|
+
}
|
252
|
+
params = system_params("taobao.itemcats.get", api_key).merge(action_params)
|
253
|
+
my_sign = get_sign(params, secret).upcase
|
254
|
+
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
|
255
|
+
end
|
256
|
+
|
177
257
|
end
|
178
258
|
end
|
data/lib/tbkapi/version.rb
CHANGED
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.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 刘梦晨
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|