lib/tbkapi/api_taobaoke.rb in tbkapi-1.1.0 vs lib/tbkapi/api_taobaoke.rb in tbkapi-1.1.2
- old
+ new
@@ -31,10 +31,11 @@
params = system_params("taobao.tbk.uatm.favorites.item.get",api_key).merge(action_params)
my_sign = get_sign(params, secret).upcase
Net::HTTP.get(URI(TBURI + '?' + build_query(params.merge({sign: my_sign}))))
end
+ # 只有 start_price 与 end_price 同时不为nil的时候价格筛选才生效
def taobao_tbk_item_get_new(keyword, cat, sort, is_tmall, start_price, end_price, api_key, secret, page_no = 1, page_size = 20)
action_params = {
fields: "num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick",
page_no: page_no,
page_size: page_size
@@ -190,9 +191,35 @@
password_content: password_content
}
params = system_params("taobao.wireless.share.tpwd.query", api_key).merge(action_params)
my_sign = get_sign(params, secret).upcase
Net::HTTP.get(URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))))
+ end
+
+ # 只有 start_price 与 end_price 有一个不为nil的时候价格筛选就生效
+ # npx_level include_pay_rate_30 include_good_rate include_rfd_rate 测试没什么效果
+ # start_dsr 0 - 50000
+ 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)
+ action_params = {
+ adzone_id: adzone_id,
+ material_id: material_id,
+ page_no: page_no,
+ page_size: page_size
+ }
+ action_params[:q] = keyword unless keyword.nil?
+ action_params[:cat] = cat unless cat.nil?
+ action_params[:sort] = sort unless sort.nil?
+ action_params[:is_tmall] = is_tmall unless is_tmall.nil?
+ action_params[:is_overseas] = is_overseas unless is_overseas.nil?
+ action_params[:has_coupon] = has_coupon unless has_coupon.nil?
+ action_params[:start_dsr] = start_dsr unless start_dsr.nil?
+ action_params[:start_tk_rate] = start_tk_rate unless start_tk_rate.nil?
+ action_params[:end_tk_rate] = end_tk_rate unless end_tk_rate.nil?
+ action_params[:start_price] = start_price unless start_price.nil?
+ action_params[:end_price] = end_price unless end_price.nil?
+ params = system_params("taobao.tbk.dg.material.optional",api_key).merge(action_params)
+ my_sign = get_sign(params, secret).upcase
+ Net::HTTP.get(URI(URI.encode((TBURI + '?' + build_query(params.merge({sign: my_sign}))))))
end
def taobao_tbk_dg_optimus_material(adzone_id, api_key, secret, material_id = 4071, page_no = 1, page_size = 20)
action_params = {
adzone_id: adzone_id,