php
$appKey,
'method' => $method,
'fields' => 'num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url',
'q' => '女装',
'cat' => '16,18',
'platform' => '1',
'page_no' => '1',
'page_size' => '20',
'sort' => 'tk_rate_des',
];
$sign = createSign($params, $appSecret);
$params['sign'] = $sign;
$url = $apiUrl . '?' . http_build_query($params);
$response = file_get_contents($url);
$data = json_decode($response, true);
foreach ($data['results']['n_tbk_item'] as $item) {
echo '
';
echo '
';
}
function createSign($params, $appSecret)
{
ksort($params);
$str = '';
foreach ($params as $key => $value) {
$str .= $key . $value;
}
return strtoupper(md5($appSecret . $str . $appSecret));
}
?>
商品标题:' . $item['title'] . '
'; echo '商品价格:' . $item['zk_final_price'] . '
'; echo '商品销量:' . $item['volume'] . '
'; echo ''; echo '查看详情'; echo '顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-