Home »  Index · Download · Documentation · Example Usage · License · Credits ·

When did either Google or Yahoo! visit my website?

The following sample usage will show you how to query all GoogleBot and Yahoo! Slurp hits on your website and convert them into an RSS feed with this class.

PHP Source Code


<?php

/**
 * @see ApacheLogAnalyzer2Feed
 */
require_once 'ApacheLogAnalyzer2Feed.php';

// create an instance, parse access.log and write test.xml
$tool = new ApacheLogAnalyzer2Feed('access.log''test.xml');
// check Googlebot Useragent with a regular expression pattern
$tool->addFilter('User-Agent''regexp:Googlebot');
// check Slurp Useragent with a regular expression pattern
$tool->addFilter('User-Agent''regexp:Slurp');
// OR filter mode
$tool->setFilterCallback(ApacheLogAnalyzer2Feed::FILTER_MODE_OR);
// run
$tool->run();