- <?php
- @set_time_limit(0); //不限制超时时间
- @session_write_close(); //关闭session
- @ini_set('memory_limit', '64M'); //设置允许使用的内存
- define('JIEQI_MODULE_NAME', 'article'); //定义程序所属模块
- include_once('../global.php'); //载入公共程序
- ob_flush();
- jieqi_includedb(); //载入数据库类
- $query=JieqiQueryHandler::getInstance('JieqiQueryHandler');
- jieqi_getconfigs('article', 'sort'); //包含文章类别
- jieqi_getconfigs('article', 'configs'); //包含小说配置
- //查询过去5分钟更新的小说
- $nowtime = date("Y-m-d H:i:s",time());
- $now_time = strtotime($nowtime);
- $dur = 600;
- $pasttime = $now_time - $dur;
- $sql = "SELECT `articleid`,`lastchapterid` FROM ".jieqi_dbprefix('article_article')." WHERE lastupdate >'".$pasttime."' ";
- $res=$query->execute($sql);
- $rowsnum = $query->db->getRowsNum($res); //总结果数
- $row='';
- $fp = fopen("pingbaidu.log",'ab'); //以二进制追加方式打开文件,没文件就创建
- while($row=$query->getRow()){
- $urls[] = "http://www.xxx.com/book/".$row['articleid'].".html"; //输出数据(这里是你的网站网址格式,按你自己的格式来修改)
- }
- $api = 'http://data.zz.baidu.com/urls?site=www.xxx.com&token=6yKwKWId8j9gJ4o6';(这里是百度推送接口地址,修改成你自己的)
- $ch = curl_init();
- $options = array(
- CURLOPT_URL => $api,
- CURLOPT_POST => true,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POSTFIELDS => implode("\n", $urls),
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- );
- curl_setopt_array($ch, $options);
- $result = curl_exec($ch);
- $result= $result."\n";
- fwrite($fp, $result, strlen($result));
- fclose($fp); //关闭文件
- flush();
- ?>
复制代码
报错是
Parse error: syntax error, unexpected T_VARIABLE in D:\wwwroot\www.xxx.com\tui.php on line 30 |