<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Detect Bots By Parsing The User Agent With PHP</title>
	<atom:link href="http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html/feed" rel="self" type="application/rss+xml" />
	<link>http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html</link>
	<description>From Cody Taylor.</description>
	<lastBuildDate>Thu, 13 Oct 2011 06:41:44 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: anon</title>
		<link>http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html/comment-page-1#comment-4204</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Wed, 19 Aug 2009 23:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14119#comment-4204</guid>
		<description>Jurian is right in that you ought to return true/false instead of 1/0.

Interesting idea, but maintaining a list of bots is painful and annoying, hence why Jurian recommends browscap.

However, please examine these test results before using browscap for any large project. In order for it to be a viable solution -- even with caching -- it would have to be several orders of magnitude faster.

Dual core Xeon E3110 3.16GHz, 4GB RAM, Apache/2.2.11 (Unix) and PHP 5.2.9 - Load Avg: 0.20, 0.20, 0.13.

Using PHP&#039;s get_browser() and php_browscap.ini: 0.0370211601257 sec

Using Browscap.php class and php_browscap.ini: 0.0388770103455 sec

Using PHP&#039;s get_browser() and lite_php_browscap.ini: 0.0258259773254 sec

Using Browscap.php class and lite_php_browscap.ini: 0.0213708877563 sec</description>
		<content:encoded><![CDATA[<p>Jurian is right in that you ought to return true/false instead of 1/0.</p>
<p>Interesting idea, but maintaining a list of bots is painful and annoying, hence why Jurian recommends browscap.</p>
<p>However, please examine these test results before using browscap for any large project. In order for it to be a viable solution &#8212; even with caching &#8212; it would have to be several orders of magnitude faster.</p>
<p>Dual core Xeon E3110 3.16GHz, 4GB RAM, Apache/2.2.11 (Unix) and PHP 5.2.9 &#8211; Load Avg: 0.20, 0.20, 0.13.</p>
<p>Using PHP&#8217;s get_browser() and php_browscap.ini: 0.0370211601257 sec</p>
<p>Using Browscap.php class and php_browscap.ini: 0.0388770103455 sec</p>
<p>Using PHP&#8217;s get_browser() and lite_php_browscap.ini: 0.0258259773254 sec</p>
<p>Using Browscap.php class and lite_php_browscap.ini: 0.0213708877563 sec</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurian Sluiman</title>
		<link>http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html/comment-page-1#comment-3029</link>
		<dc:creator>Jurian Sluiman</dc:creator>
		<pubDate>Mon, 15 Jun 2009 20:46:09 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14119#comment-3029</guid>
		<description>First one point about your coding style: if you&#039;re using a function where you expect a boolean result, please return booleans. Though php is waked typed, its much better to have your controller functions returning the right type. When you&#039;re inserting the data inside your database, you can always cast it back to anything you want.

The second thing: if you want to determine the visitor based on the user agent, it&#039;s smart to use browscap (http://code.google.com/p/phpbrowscap/). That&#039;s a very reliable solution for user agent detection (and even will you help for further statistics!).</description>
		<content:encoded><![CDATA[<p>First one point about your coding style: if you&#8217;re using a function where you expect a boolean result, please return booleans. Though php is waked typed, its much better to have your controller functions returning the right type. When you&#8217;re inserting the data inside your database, you can always cast it back to anything you want.</p>
<p>The second thing: if you want to determine the visitor based on the user agent, it&#8217;s smart to use browscap (<a href="http://code.google.com/p/phpbrowscap/)" rel="nofollow">http://code.google.com/p/phpbrowscap/)</a>. That&#8217;s a very reliable solution for user agent detection (and even will you help for further statistics!).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abcphp.com</title>
		<link>http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html/comment-page-1#comment-3016</link>
		<dc:creator>abcphp.com</dc:creator>
		<pubDate>Mon, 15 Jun 2009 08:39:53 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14119#comment-3016</guid>
		<description>&lt;strong&gt;Detect Bots By Parsing The User Agent With PHP...&lt;/strong&gt;

Because I’ve been starting to keep a closer eye on my traffic I’ve been logging everything to my databases. When writing reports for this information I noticed that there was huge amounts of traffic from bots. Yahoo, Google, MSN and many others have be...</description>
		<content:encoded><![CDATA[<p><strong>Detect Bots By Parsing The User Agent With PHP&#8230;</strong></p>
<p>Because I’ve been starting to keep a closer eye on my traffic I’ve been logging everything to my databases. When writing reports for this information I noticed that there was huge amounts of traffic from bots. Yahoo, Google, MSN and many others have be&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody Taylor</title>
		<link>http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html/comment-page-1#comment-3009</link>
		<dc:creator>Cody Taylor</dc:creator>
		<pubDate>Sun, 14 Jun 2009 21:20:06 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14119#comment-3009</guid>
		<description>I insert at the very end of the page after I flush everything out so there will be no delay of content even if the db is bogged down. And if I was give it to someone else who is using iis I would have to recode the entire thing. Also when doing reporting on large sets of data I don&#039;t want to have to parse huge log files for every report.</description>
		<content:encoded><![CDATA[<p>I insert at the very end of the page after I flush everything out so there will be no delay of content even if the db is bogged down. And if I was give it to someone else who is using iis I would have to recode the entire thing. Also when doing reporting on large sets of data I don&#8217;t want to have to parse huge log files for every report.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Old Man</title>
		<link>http://codytaylor.org/2009/06/detect-bots-by-parsing-the-user-agent-with-php.html/comment-page-1#comment-3008</link>
		<dc:creator>Old Man</dc:creator>
		<pubDate>Sun, 14 Jun 2009 21:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://codytaylor.org/?p=14119#comment-3008</guid>
		<description>It seems unecessary to log things in your database. First of all it will probably increase the time for your page to generate. And it also seems a bit uncessary when the web server logs everything anyway?

Why don&#039;t you just parse the web servers logs?

If you need more information than is available, you can add information to the apache logs directly:
http://ca.php.net/manual/en/function.apache-note.php</description>
		<content:encoded><![CDATA[<p>It seems unecessary to log things in your database. First of all it will probably increase the time for your page to generate. And it also seems a bit uncessary when the web server logs everything anyway?</p>
<p>Why don&#8217;t you just parse the web servers logs?</p>
<p>If you need more information than is available, you can add information to the apache logs directly:<br />
<a href="http://ca.php.net/manual/en/function.apache-note.php" rel="nofollow">http://ca.php.net/manual/en/function.apache-note.php</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

