Browse Source

Merge pull request 'wpd_delta2' (#60) from wpd_delta2 into master

Reviewed-on: #60
master
pengda 5 days ago
parent
commit
49246823bd
  1. 25
      control/weibo.php
  2. 1
      queue/crontab/spider_behavior_delta.php

25
control/weibo.php

@ -134,20 +134,29 @@ class weibo extends publicBase {
} }
public function ajax_update_cookie() { public function ajax_update_cookie() {
$cookie = trim($this->get('cookie'));
if (empty($cookie)) $this->ajax_json(false, '参数错误');
$type = $this->get('type') + 0;
$obj = new mWeiboBehavior(); $obj = new mWeiboBehavior();
//设置cookie
$cookie = trim($this->get('cookie'));
if($cookie){
$robj = $obj->initRedis(); $robj = $obj->initRedis();
$robj->set(_RC_WEIBO_LOGIN_COOKIE, $cookie); $robj->set(_RC_WEIBO_LOGIN_COOKIE, $cookie);
}
if ($type == 0) { //抓取
$type = $this->get('type') + 0;
if ($type) {
shell_exec("nohup /usr/bin/php /data1/www/zhishiku.yizherenxin.cn/queue/crontab/spider_behavior_data.php > /dev/null 2>&1 &"); shell_exec("nohup /usr/bin/php /data1/www/zhishiku.yizherenxin.cn/queue/crontab/spider_behavior_data.php > /dev/null 2>&1 &");
$this->ajax_json(true, '设置成功'); $this->ajax_json(true, '111');
}
//统计某日期增量
$date = trim($this->get('date'));
if($date){
shell_exec("nohup /usr/bin/php /data1/www/zhishiku.yizherenxin.cn/queue/crontab/spider_behavior_delta.php {$date} > /dev/null 2>&1 &");
$this->ajax_json(true, '222');
} }
shell_exec("nohup /usr/bin/php /data1/www/zhishiku.yizherenxin.cn/queue/crontab/spider_behavior_delta.php > /dev/null 2>&1 &"); $this->ajax_json(true, '333');
$this->ajax_json(true, '设置成功');
} }
} }

1
queue/crontab/spider_behavior_delta.php

@ -17,6 +17,7 @@ class spiderBehaviorDelta {
//统计今日增量 //统计今日增量
$today = date('Y-m-d',strtotime(DATE)); $today = date('Y-m-d',strtotime(DATE));
if(DATE == '') $today = date('Y-m-d');
$page_num = 1; $page_num = 1;
$page_size = 2000; $page_size = 2000;

Loading…
Cancel
Save