淘宝API的应用
http://joan0106.iteye.com/blog/922319
阅读(1171) | 评论(1) | 转发(2) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
在http://open.taobao.com开放平台下载相应的最新的sdk,如你懂得php,就下载php的sdk,然后解压把top目录添加到自己的项目中。
新建一个index.php
- <?php
- include("top/TopClient.php");
- include("top/request/ItemGetRequest.php");
- $appKey = '自己的appKey'; //自己申请成为开发者,必须要经过实名认证
- $appSecret = '自己的appSecret';
- 沙箱默认的appkey:test ,appSecrect:test
- //实例化TopClient类
- $c = new TopClient();
- $c->appkey = $appKey;
- $c->secretKey = $appSecret;
- //实例化商品的Request类
- $req = new ItemGetRequest;
- $req->setFields("detail_url,num_iid,title,nick,type,cid,seller_cids,props,input_pids,input_str,desc");
- $req->setNumIid(1452115837);
- $resp = $c->execute($req);
- print_r($resp);
- ?>
相关热门文章