lib/tbkapi/api_taobaoke.rb in tbkapi-1.0.0 vs lib/tbkapi/api_taobaoke.rb in tbkapi-1.0.1

- old
+ new

@@ -113,10 +113,25 @@ params = system_params("taobao.tbk.dg.item.coupon.get", 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 + def taobao_tbk_tpwd_create(url, text, api_key, secret, logo = nil, user_id = nil) + data = { + text: text, + url: url + } + data[:logo] = logo if logo + data[:user_id] = user_id if user_id + action_params = { + tpwd_param: data.to_json + } + params = system_params("taobao.tbk.tpwd.create", 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 + def taobao_wireless_share_tpwd_create(url, text, api_key, secret, logo = nil, user_id = nil) data = { text: text, url: url } @@ -137,7 +152,18 @@ 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 + 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, + material_id: material_id, + page_no: page_no, + page_size: page_size + } + params = system_params("taobao.tbk.dg.optimus.material", 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 end end