php采集回调
来源:互联网 发布:深圳淘宝客服工资多少 编辑:程序博客网 时间:2024/06/06 16:32
<?phpinclude('CURL.php');$db=new PDO('mysql:dbname=haicheji;host=localhost','root','123456');$db->exec("set names utf8");$curl=new CUrl();$curl->task='demo4_addTask';$curl->go();//取还没有添加的任务function demo4_addTask(){global $baseUrl,$db,$curl;static $lastId=0;$limit=100;$list=$db->query("select id,url from html where id>$lastId and tag is null order by id limit $limit")->fetchAll();if(count($list)>0){foreach($list as $v){$url=array($v['url']);$callback=array('demo4_cb1',array($v['id']));$curl->add($url,$callback);}$lastId=$v['id'];}else $lastId=$lastId+1;}//处理回调函数function demo4_cb1($r,$id){global $db,$curl;if($r['info']['http_code']==200){$html=$r['content'];$rs=$db->prepare("update html set html=?,tag=1 where id=?");$rs->execute(array($html,$id));}$curl->status();}
0 0
- php采集回调
- PHP采集
- php采集
- php采集
- PHP采集
- php信息采集程序
- PHP采集利器:Snoopy
- php采集论坛
- php 采集入库
- PHP采集代码实例
- php数据采集
- PHP采集 抓取
- PHP采集利器:Snoopy
- PHP采集防IP
- PHP采集 抓取
- PHP采集程序(爬虫)
- php socket采集实例
- PHP数据采集
- 解决vs2010 SQL Server Compact 3.5出错
- Java学习记录(9)——多态
- android 6.0 运行时详解
- 类AudioTrack的函数getMinFrameCount(java侧为getMinBufferSize)
- no space left device
- php采集回调
- 音视频基础概念与流程
- C 语言中getch()、getche()和getchar()函数之间的区别以及缓冲区的概念
- html5-canvas(多模式彩色贪吃蛇)
- centos7 安装npm
- js不常用属性
- NOI题库 310:Is It A Tree?
- 在IDEA中使用MyBatis Generator逆向工程生成代码
- 使用Xshell工具连接虚拟机