public function __construct() { // 初始化爬虫 $configs = Crawler::getCrawlerConfigs(); $this->crawler = Boot::curl($configs); // 初始化分析器 $this->analysis = Boot::analysis(); }
/** * 设置两个用户名 */ protected function setName() { preg_match($this->regexs['name'], $this->data, $name); if (DEBUG == true) { echo 'the name regex is '; var_dump($name); } $this->afterAnalysis['username'] = $name[1]; $this->afterAnalysis['nickname'] = Crawler::getCurrentUsername(); }
protected function getSize() { $this->endCounts = Crawler::getTimes(); $this->size = $this->redis->get('limitSize'); }