public function actionKeywords($param_date = 'Today')
 {
     $date = date('Y-m-d', strtotime($param_date));
     if ($this->checkHasFileByDate(2, $date)) {
         return $this->echoLog("has file,date:{$date} ");
     }
     $cookie = $this->getAuthCookie(2);
     $url = "https://web.umeng.com/main.php?c=traf&a=keyword&ajax=module=report&siteid=1259302647&st={$date}&et={$date}&tabIndex=1&keywordCondType=&keyword=&itemName=&itemNameType=&itemVal=&engin=all&orderBy=pv&orderType=-1&currentPage=1&pageType=90&downloadType=csv";
     HttpClient::setCookie($cookie);
     $ret = HttpClient::get($url);
     if (!$ret) {
         $this->echoLog(HttpClient::getLastErrorMsg());
         return;
     }
     $params = ['type' => 2, 'action' => 1, 'date' => $date];
     $this->save2File("keywordlist_umeng_{$date}_" . date("YmdHis") . ".csv", $ret, $params);
 }
Exemple #2
0
 public function actionKeywords($param_date = 'Today')
 {
     $date = date('Y-m-d', strtotime($param_date));
     if ($this->checkHasFileByDate(1, $date)) {
         //return $this->echoLog("has file,date:{$date} ");
     }
     $cookie = $this->getAuthCookie(1);
     $url = "http://zhanzhang.baidu.com/keywords/keywordlist?site=http%3A%2F%2Fwww.vincentguo.cn%2F&range={$date}&download=true&searchItem=";
     HttpClient::setCookie($cookie);
     $ret = HttpClient::get($url);
     if (stripos($ret, 'Too many downloads') !== false) {
         //错误了
         $this->echoLog($ret);
         return;
     }
     if (!$ret) {
         $this->echoLog(HttpClient::getLastErrorMsg());
         return;
     }
     $params = ['type' => 1, 'action' => 1, 'date' => $date];
     $this->save2File("keywordlist_bd_{$date}_" . date("YmdHis") . ".csv", $ret, $params);
 }