|
|
@ -2,7 +2,7 @@ |
|
|
|
/** |
|
|
|
* |
|
|
|
*/ |
|
|
|
include_once(SERVER_ROOT."/model/mBase.php"); |
|
|
|
include_once(SERVER_ROOT . "/model/mBase.php"); |
|
|
|
|
|
|
|
|
|
|
|
class mSpider extends mBase { |
|
|
@ -14,10 +14,10 @@ class mSpider extends mBase { |
|
|
|
|
|
|
|
public function getZmhttpIp($task_key) { |
|
|
|
$rdobj = $this->initRedis(); |
|
|
|
$aa = $rdobj->get('aaa'); |
|
|
|
if($aa) return false; |
|
|
|
$ip_request = $rdobj->get('ip_request'); |
|
|
|
if ($ip_request) return false; |
|
|
|
|
|
|
|
$rdobj->setex('aaa', 60, 1); |
|
|
|
$rdobj->setex('ip_request', 60, 1); |
|
|
|
|
|
|
|
$url = "http://proxy.siyetian.com/apis_get.html?token=AesJWLNp2a65kaJdXTqFFeNpWT35ERNpnTn1STqFUeORUR31kaNh3TUl0dPRUQy4ERJdXT6lVN.QMxkTO0MjM0cTM&limit=1&type=1&time=&data_format=json&showTimeEnd=true"; |
|
|
|
$jsoninfo = $this->getCUrl($url); |
|
|
@ -124,7 +124,7 @@ class mSpider extends mBase { |
|
|
|
$html = $this->getRequest($url, $headers); |
|
|
|
if (!$html) { |
|
|
|
$this->setError($this->curl_err); |
|
|
|
$this->writeLog('spider', 'curl_error.log', $this->curl_err."|".$url."|".$html); |
|
|
|
$this->writeLog('spider', 'curl_error.log', $this->curl_err . "|" . $url . "|" . $html); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
@ -138,7 +138,7 @@ class mSpider extends mBase { |
|
|
|
$content = $data[0]['status']; |
|
|
|
} |
|
|
|
} |
|
|
|
if(empty($content)) { |
|
|
|
if (empty($content)) { |
|
|
|
$this->setError($html); |
|
|
|
return 'error'; |
|
|
|
} |
|
|
@ -163,7 +163,7 @@ class mSpider extends mBase { |
|
|
|
$return['comments_count'] = $content['comments_count']; |
|
|
|
$return['attitudes_count'] = $content['attitudes_count']; |
|
|
|
|
|
|
|
if($content['retweeted_status']){ |
|
|
|
if ($content['retweeted_status']) { |
|
|
|
$return['retweeted_status'] = array(); |
|
|
|
|
|
|
|
$return['retweeted_status']['wid'] = $content['retweeted_status']['id']; |
|
|
|