仙人掌治痔疮:PHP写的记录各大蜘蛛活动信息的脚本
来源:百度文库 编辑:中财网 时间:2024/05/08 13:14:16
PHP写的记录各大蜘蛛活动信息的脚本
[ 2006/10/29 00:22 | by sangern ] 每次下载页面时,根据$useragent判断客户端的类型,以此确定用户类型,如果是对用的蜘蛛,则把蜘蛛活动时间以及蜘蛛信息记录在文件中。<>
- {
$fp2 = @fopen($cachename,"w"); - @ flock($fp2,2);
- @ fwrite($fp2,$sData);
- @ fclose($fp2);
- $mystr="ok";
- return $mystr;
- }
- function get_naps_bot()
- {
- $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
- if ( strpos($useragent, "googlebot") !== false){
- return 'Googlebot';
- }
- if ( strpos($useragent, "Googlebot") !== false){
- return 'Googlebot';
- }
- if ( strpos($useragent, "msnbot") !== false){
- return "MSNbot";
- }
- if ( strpos($useragent, "slurp") !== false){
- return "Yahoobot";
- }
- if ( strpos($useragent, 'baiduspider') !== false){
- return "Baiduspider";
- }
- if ( strpos($useragent, "sohu-search") !== false){
- return "Sohubot";
- }
- if ( strpos($useragent, "lycos") !== false){
- return "Lycos";
- }
- if ( strpos($useragent, "robozilla") !== false){
- return "Robozilla";
- }
- if ( strpos($useragent, "SpiderMan") !== false){
- return "SpiderMan";
- }
- if ( strpos($useragent, "Baiduspider") !== false){
- return "Baiduspider";
- }
- return false;
- }
- $tlc_thispage = addslashes($_SERVER['HTTP_USER_AGENT']);
- //添加蜘蛛的抓取记录
- $searchbot = get_naps_bot();
- if ( $searchbot) {
- $BotData="";
- $BotData=$searchbot.",".$tlc_thispage.",".date("Y-m-d H:i:s");
- writefiles("cache/".$searchbot.date("YmdHis").".txt",$BotData);
- //echo"";
- }
- ?>
求写活动记录的文章模版?
关于供销的安全活动记录谁会写?
普通话活动课的记录
什么网站上有北京各大商场打折促销活动的最新(即时)信息
小蜘蛛长成大蜘蛛的时间,指最普通的那些蜘蛛
小说《蜘蛛丝》是谁写的
小说《蜘蛛丝》是谁写的
怎样记录表单的信息
梦到两只绿色的大蜘蛛
想用PHP,把文本内容,写进MYSQL数据库中,不同于一行一条记录的文本数据库!
怎么样查看近期电脑的活动记录
李大钊在河北的活动记录
各大高校开展的精神文明活动
PHP 查下一条记录的函数是什么..
php 怎样取某一字段非空的记录?
谁知到哪里可以查到大商场打折活动的信息?
学习心得交流活动记录 怎么写
请问如何写活动记录呀?
求教简单的php代码如何写?
求教简单的php代码如何写?
推荐一款写PHP的软件
真的有人用PHP写应用程序?
请问脚本编写的技巧?谁能教我写脚本阿??
我想请问一下,爬进屋的蜘蛛,比较大,是灰色的,这种蜘蛛有毒吗?