惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
Scott Helme
Scott Helme
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
量子位
Jina AI
Jina AI
I
InfoQ
V
V2EX
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
B
Blog
IT之家
IT之家
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
博客园 - 【当耐特】
N
Netflix TechBlog - Medium
Cloudbric
Cloudbric
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
S
Security @ Cisco Blogs
U
Unit 42
Project Zero
Project Zero
Webroot Blog
Webroot Blog
The Register - Security
The Register - Security
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
Forbes - Security
Forbes - Security
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
C
Check Point Blog
博客园 - 聂微东
M
MIT News - Artificial intelligence
有赞技术团队
有赞技术团队
D
DataBreaches.Net
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
G
Google Developers Blog
GbyAI
GbyAI
T
Threatpost

博客园 - 亲,注意身体

magento 数据清理 magento top menu edit CookieConter 转换为string magento sitemap cms page remove home and generate sitemap error magento toplink blank li magento 语言包 magetno awblog auto generate title id, js replace magento moneybooker 操作 JS 正则 js 数组 组合(转) magento checkout require moneybooker api/mqi query magento moneybooker redirect 添加信任站点 bat 设置信任站点等级 moneybooker api 文档 magento htaccess Navicat 注册码,序列号 magento 修改订单号 Magento 删除所有订单 适于于1.4+
magento 记录蜘蛛爬行日志
亲,注意身体 · 2012-03-17 · via 博客园 - 亲,注意身体

<?php  
 function isSpider(){
    $bots = array(
                    'google'    => 'googlebot',
                    'yahoo'        => 'yahoo slurp',
                    'soso'        => 'sosospider',
                    'msn'        => 'msnbot',
                    'altavista'    => 'scooter',
                    'sogou'        => 'sogou spider',
                    'bing'        => 'bing',
                    'yodao'        => 'yodaobot',
                    
                    
            );
    $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
    foreach ($bots as $k => $v){
    
        if (strstr($userAgent,$k)){
            return $v;
            break;
        }
    }
    return false;
}
$spi= isSpider();
if($spi){
    $tlc_thispage    = addslashes($_SERVER['HTTP_USER_AGENT']);
    //$file            = 'r.txt';
    $time            = date('Y-m-d H:i:s',mktime());
    //$handle            = fopen($file,'a+');
    $PR                = $_SERVER['REQUEST_URI'];
mysql_connect("localhost","root","");//连接MySQL
mysql_select_db("db");//选择数据库
$sql = "insert into robots(website,robot,url,agent,time) values ('website','$spi','$PR','$tlc_thispage','$time')";
mysql_query($sql);//借SQL语句插入数据
mysql_close();//关闭MySQL连接
 //echo  "Time:{$time} ROBOT:{$spi} AGENT:{$tlc_thispage} URL:{$PR} \n\r";
   // fwrite($handle, "Time:{$time} ROBOT:{$spi} AGENT:{$tlc_thispage} URL:{$PR} \n\r");
    //fclose($handle);
}
?>

CREATE TABLE `robots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `website` varchar(20) NOT NULL,
  `url` varchar(300) NOT NULL,
  `robot` varchar(20) NOT NULL,
  `time` datetime DEFAULT NULL,
  `agent` varchar(50) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;