lib/tbkapi/api_taobaoke.rb in tbkapi-0.0.6 vs lib/tbkapi/api_taobaoke.rb in tbkapi-0.0.7

- old
+ new

@@ -35,11 +35,11 @@ def taobao_tbk_item_get(keyword, 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,status,category,coupon_click_url,coupon_end_time,coupon_info,coupon_start_time,coupon_total_count,coupon_remain_count", + fields: "num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url,seller_id,volume,nick", q: keyword, page_no: page_no, page_size: page_size } params = system_params("taobao.tbk.item.get",api_key).merge(action_params) @@ -68,9 +68,31 @@ url = URI(TBURI + '?' + URI.escape(build_query(params.merge({sign: my_sign})),'/:?')) else url = URI(TBURI + '?' + URI.encode(build_query(params.merge({sign: my_sign})))) end Net::HTTP.get(url) + end + + def taobao_tbk_shop_get(q, api_key, secret) + action_params ={ + fields: "user_id,shop_title,shop_type,seller_nick,pict_url,shop_url", + q: q + } + params = system_params("taobao.tbk.shop.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_ju_items_search(q, pid, api_key, secret) + action_params ={ + param_top_item_query: { + pid: pid, + word: q + }.to_json + } + params = system_params("taobao.ju.items.search", 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