PHP淘宝客源码分享

流氓凡 PHP程序源码 2017-06-12 5.84 K 0

转载原帖:晨风论坛 By:独行者

使用方法,源码直接上传自己虚拟主机按照下方访问即可!

http://域名/文件名.php?msg=1  实时跑单API接口
http://域名/文件名.php?msg=2 今日精选API接口

http://域名/文件名.php?msg=3  今日TOP榜API接口
http://域名/文件名.php?msg=4  券飙升榜API接口
http://域名/文件名.php?msg=5  人气宝贝品API接口


如果你需要晨风机器人调用,格式如下:

淘客商品      【显示网址内容http://域名/文件名.php?msg=1】

如果你需要晨风机器人定时调用,格式如下:

淘客商品      【显示网址内容http://域名/文件名.php?msg=1】 放在任意文本文档中,然后放到机器人更多小游戏文件夹内

定时任务列表填写格式: 淘客商品【定时任务游戏】      间隔5分钟


PHP源码如下:

<?php

if(isset($_GET['msg'])){
$msg=$_GET['msg'];



if($msg > 5){
exit('数据错误,请检查..');
}



$pid='mm_101079143_9134205_30662411'; //引号里面的数据替换成自已的。



if($msg==1){
        $msg='paodan';//实时跑单API接口
}elseif($msg==2){
        $msg='jingxuan';//今日精选API接口
}elseif($msg==3){
        $msg='top';//今日TOP榜API接口
}elseif($msg==4){
        $msg='quan';//券飙升榜API接口
}elseif($msg==5){
        $msg='renqi';//人气宝贝品API接口
}

$suiji = rand(1,20); //取随机数;
$url = 'http://api.zhaohaodan.com/Port/goodsList/type/'.$msg.'/page/'.$suiji;  //商品数据接口
    $city = file_get_contents($url);
    $city = json_decode($city, true);
        $location = $city["data"][$suiji];

        $title=$location['title'];//取标题
        $img="[imgurl]".$location['pic']."[/imgurl]";//取图片
        $remark=$location['remark'];//推荐理由
        $price=$location['price'];//商品价格
        $discount=$location['discount'];//折扣
        $coupon_money=$location['coupon_money'];//优惠金额
        $num_iid=$location['num_iid'];//商品id
        preg_match_all('/activityId=(.*?)h/',$location['coupon_url'].'h',$coupon_url);//正则取优惠券id
        $coupon_urls=$coupon_url[1][0];

$urlss='http://uland.taobao.com/coupon/edetail?activityId='.$coupon_urls.'&pid='.$pid.'&itemId='.$num_iid.'&src=qhkj_dtkp&dx=1';


exit($img.'<br/>商品:'.$title.'<br/>价格:'.$price.' 折扣:'.$discount.' 优惠:'.$coupon_money.'<br/>购买链接:'.$urlss.'<br/>推荐理由:'.$remark);
}else{
        exit('请传递msg参数');
}


?>

上述源码注意替换自己的 PID哦~

评论