<?php namespace app; require './network/Network.php'; require './WxSpider.php'; use app\utils\sogoWx\WxSpider; $wxSpider = new WxSpider(); $wxSpider->getAccounts('华德福');
<?php namespace app; require './network/Network.php'; require './WxSpider.php'; use app\utils\sogoWx\WxSpider; $wxSpider = new WxSpider(); $wxSpider->getAccounts('头发');
private function getData($url) { set_time_limit(60); //每次请求,多加60秒等待时间,避免timeout $md5 = md5($url); $data = WxSpider::getCache($md5); if ($data) { return unserialize($data); } $data = $this->network->get($url); WxSpider::setCache($md5, serialize($data)); return $data; }