Reply
Tue 3 Feb, 2004 12:27 pm
there's a site called botspotter, pm me for the link, that keeps track of who, what and when spyders come to your site by adding a php include in the page you want monitored. you then go to their site login and check. I tried this with index.php for phpbb and I got this error:
Warning: Failed opening './botspotterphp' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/34/d87885992/htdocs/index.php on line 29
Warning: Cannot add header information - headers already sent by (output started at /homepages/34/d87885992/htdocs/index.php:29) in /homepages/34/d87885992/htdocs/includes/page_header.php on line 724
Warning: Cannot add header information - headers already sent by (output started at /homepages/34/d87885992/htdocs/index.php:29) in /homepages/34/d87885992/htdocs/includes/page_header.php on line 726
Warning: Cannot add header information - headers already sent by (output started at /homepages/34/d87885992/htdocs/index.php:29) in /homepages/34/d87885992/htdocs/includes/page_header.php on line 727
I made this page called botspotter.php:
<?php// Script Date: 09 Jan 2004
// your botspotter login name
$bsName = 'khisanthax';
// change nothing below this line
function getURI() {
global $HTTP_SERVER_VARS;
$url = '/';
if ( !empty($HTTP_SERVER_VARS['PHP_SELF']))
$url = $HTTP_SERVER_VARS['PHP_SELF'];
elseif ( isset ( $HTTP_SERVER_VARS['SCRIPT_URI']) && !empty($HTTP_SERVER_VARS['SCRIPT_URI']))
$url = $HTTP_SERVER_VARS['SCRIPT_URI'];
if ( isset( $HTTP_SERVER_VARS['QUERY_STRING'] ) && $HTTP_SERVER_VARS['QUERY_STRING'] != "")
$url .= '?'.$HTTP_SERVER_VARS['QUERY_STRING'];
return $url;
}//function getURI()
function getPageStatus() {
global $HTTP_SERVER_VARS, $HTTP_ENV_VARS;
if (isset($HTTP_ENV_VARS['REDIRECT_STATUS'])) return $HTTP_ENV_VARS['REDIRECT_STATUS'];
else if (isset($HTTP_SERVER_VARS['REDIRECT_STATUS'])) return $HTTP_SERVER_VARS['REDIRECT_STATUS'];
else return '200';
}//function getPageStatus()
$status = getPageStatus();
$url = 'http://www.pcpropertymanager.com/botspotter/accept.php'
. '?server=' . urlencode( $HTTP_SERVER_VARS['SERVER_NAME'])
. '&uri=' . urlencode( getURI())
. '&agent=' . urlencode( $HTTP_SERVER_VARS['HTTP_USER_AGENT'])
. '&ip=' . urlencode( $HTTP_SERVER_VARS['REMOTE_ADDR'])
. "&account={$bsName}"
. '&status=' . $status;
$fp = @fopen($url, "r") or die ("\n<a href='http://www.pcpropertymanager.com/botspotter/home.php' target='_blank'>Botspotter</a> <a href='{$url}'>disabled</a>\n");
if ($fp != false) {
fpassthru($fp);
fclose($fp);
}
$url = 'http://www.pcpropertymanager.com/botspotter/accref.php'
. '?server=' . urlencode( $HTTP_SERVER_VARS['SERVER_NAME'])
. '&uri=' . urlencode( getURI())
. "&account={$bsName}"
. '&ref=' . urlencode($HTTP_SERVER_VARS['HTTP_REFERER']);
fclose(fopen($url, 'r'));
?>
and added this line to the top of index.php:
include($phpbb_root_path . 'botspotter'.$phpEx);
can anyone tell me what I need to do to make it work right?
What you need to do is make it get called in the template as well.
Thing is, I recommend against this. Don't you have a stats program? If so doesn't it track bots?
I recommend awstats.
I got it to work, the script started with <php//whater
and it was screwing it up, but I will check out awstats, anything you recommend for me especially with way of tracking, thanks I'll look at that!
the only stats I have, I don't use my hosts cause it's garbage I think, is the codecrush ip logger and http referrer mod for phpbb
Do you have a cpanel host?
hmmmmmm, no. I dl'ed the awstats, is that something I can install myself or does the host have to do it?
I'm not sure, it probably depends on the way the server is configured. Awstats has to access the log files.
You should probably ask your host. I'm not sure how they have your box set up.
Botspotter Help
Hi khisanthax
I'm sorry that you had trouble with Botspotter, I only just found this forum and this post. Botspotter has a feedback form and I'm happy to help anyone get setup.
Botspotter is a free tool and at the moment I'm still working on it when I can. Over time it will get better and better. The advantages over a visitor hit counter will be in the understanding of how the bots work, what is a bot and what's not etc. Please stick with us, it's going to get interesting.
Sarah
As I said earlier, I strongly recommend against using Botspotter or any tracking other than server logs.
Server logs track all of this data just as well as anything else. There's no information available to Botspotter that is not available to your server logs.
So any hit counter, tracking etc that requires you to use an include or extra tracking code just unecessarily slows down your site.
You'd be better off looking for a better log intrepreting program.
Why track everything twice? You already have all the info in your server logs, just get a good program to understand them.