From: Reini U. <ru...@x-...> - 2005-02-07 10:39:59
|
Charles Corrigan schrieb: > Here are two new queries that I wrote to analyse search engine activity > from the SQL access log. These can be inserted into the > AnalyseAccessLog.inc file that I uploaded last week - the insertion point > should be just before the final "}". I see now why you wanted to exclude the queries, but I still don't feel comfortable with the seperate .inc file. That would be the first and only case, and there are several file-based methods to list all our plugins (checking for .php, well). it violates our current (unwritten) plugin policies. Also with the name change from mode to queryName. I think we want to keep "mode" for consistency. > The queries contain a list of DNS > names for search engine crawlers/spiders/whatever - but this is based only > on what I saw in my sites' accesslog. Any additions are welcome. > } elseif ($queryName=="Search Bots") { ... > ."FROM $accesslog " > ."WHERE (remote_host LIKE '%googlebot.com' " > ."OR remote_host LIKE '%alexa.com' " > ."OR remote_host LIKE '%inktomisearch.com' " > ."OR remote_host LIKE '%msnbot.msn.com') " > .($whereConditions ? 'AND '.$whereConditions : '') > ."GROUP BY 'Time Scale', 'Remote Host'"; For search bots you can constrcut the hosts string from lib/ExternalReferrer.php > } elseif ($queryName=="Search Bot Page Hits") { > // This queries for all entries in the SQL access log table that > // have a dns name that I know to be a web search engine crawler and > // displays the URI that was hit. > // If PHPSESSID appears in the URI, just display the URI to the left > of this > > $now = time(); > $query = "SELECT " > ."IF($now-time_stamp<60, '0 - last minute', IF($now > -time_stamp<3600, '1 - 1 minute to 1 hour', > IF($now-time_stamp<86400, '2 - 1 hour to 1 day', > IF($now-time_stamp<604800, '3 - 1 day to 1 week', > IF($now-time_stamp<2629800, '4 - 1 week to 1 month', > IF($now-time_stamp<31557600, '5 - 1 month to 1 year', '6 - more All these are untranslated strings. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |