skymvc/library/cls_taobao.php

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/*
header("Content-type:text/html;charset=utf-8");

$tao= new taobao();
$d=$tao->stole("http://detail.tmall.com/item.htm?spm=a1z10.4.w5003-7492062920.5.ID5r4O&id=39235427764&scene=taobao_shop");
print_r($d);
*/
class taobao
{  
    public $appkey = "21258382";  
    public $secretKey = "ac5e8a5a528170d51708515a50641b38";
	public $appconfig;  
    function __construct(){
				
    }
 	
	public function setConfig($appconfig){
		if(!empty($appconfig)){
			$this->appconfig=$appconfig;
		}
        shuffle($this->appconfig);
        $this->appkey    = $this->appconfig[0][0];
        $this->secretKey = $this->appconfig[0][1];
	}
	//采集详细页面
	public function Stole($url){
		$a=get_headers($url,1);
		if(isset($a['location'])){
			$url=$a['location'];
		}
		$arr=parse_url($url);
		parse_str($arr['query'],$a);
		$id=$a['id'];
		$c=file_get_contents($url);
		$c=iconv("gbk","utf-8",$c);
		$site="taobao";
		if(strpos($url,"tmall.com")!==false){
			$site="tmall";
		}
		switch($site){
			case "taobao":
				//TaoBao
				preg_match("/<img id=\"J_ImgBooth\" data-src=\"(.*)\"[^>]*>/iUs",$c,$a);
				$data['img']=addslashes(str_replace("_.webp","",$a[1])); 
				
				$data['taoid']=addslashes($id);
				preg_match("/<h3 class=\"tb-main-title\" data-title=\"(.*)\">/iUs",$c,$a);
				$data['title']=addslashes(trim($a[1]));
				preg_match("/<strong id=\"J_StrPrice\".*<em class=\"tb-rmb-num\">(.*)<\/em>/iUs",$c,$a);
				$data['price']=intval($a[1]*0.9);
				break;
			case "tmall":
				$data['taoid']=addslashes($id);
				preg_match("/<img id=\"J_ImgBooth\".*src=\"(.*)\"[^>]*>/iUs",$c,$a);
				$data['img']=addslashes(str_replace("_.webp","",$a[1])); 
				preg_match("/<h1 data-spm=\".*\">(.*)<\/h1>/iUs",$c,$a);
				$data['title']=addslashes(trim($a[1]));
				preg_match("/<strong class=\"J_originalPrice\">(.*)<\/strong>/iUs",$c,$a);
				$data['price']=intval($a[1]*0.9);
后面还有 301 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。