googlebot plugin
Posted at 2004-06-27T19:15:00+09:00 in Blosxom
V. W. MarshallのIn Which the Fly Invites the Spider Into His Parlorと言うエントリにinspireされて(inspireとはパクったのを誤魔化したい時に使う言葉です)、Googlebotが自分が設置したblosxomのどこかしらのページをクロールした時メールを送信するプラグイン、googlebotと言うものを作ってみました。
以下、コード。
# Blosxom Plugin: googlebot
# Author(s): Kyo Nagashima <kyo@hail2u.net>
# Version: 1.0
# Blosxom Home/Docs/Licensing: http://www.blosxom.com/
package googlebot;
use strict;
# --- Configurable variables -----------
my $sendmail = '/usr/sbin/sendmail';
my $from = 'googlebot@example.com';
my $to = 'john.doe@example.com';
my $subject = 'Welcome Googlebot.';
# --- Plug-in package variables --------
# --------------------------------------
sub start {
if (
$ENV{'HTTP_USER_AGENT'} =~ /Googlebot/ and
open(MAIL, "| $sendmail -t")
) {
print MAIL <<"_MAIL_";
From: $from
To: $to
Subject: $subject
Content-Type: text/plain; charset=ISO-2022-JP
Googlebot tries to index the following page:
http://example.com$ENV{'REQUEST_URI'}
_MAIL_
close(MAIL);
}
return 0;
}
1;
てか、使ってないので動くかどうかは知りませんけど。
なんて奴だ。
inspire元のエントリにもあるように、いろいろな検索エンジンのロボットをトラッキングすると面白いかもしれないですね。
Weblog archives
by Month
- October, 2006 (9)
- September, 2006 (23)
- August, 2006 (31)
- July, 2006 (8)
- October, 2005 (13)
- September, 2005 (24)
- August, 2005 (26)
- July, 2005 (2)
- June, 2005 (2)
- May, 2005 (13)
- April, 2005 (30)
- March, 2005 (33)
- February, 2005 (13)
- January, 2005 (10)
- December, 2004 (28)
- November, 2004 (27)
- October, 2004 (25)
- September, 2004 (38)
- August, 2004 (52)
- July, 2004 (45)
- June, 2004 (41)
- May, 2004 (48)
- April, 2004 (36)
- March, 2004 (51)
- February, 2004 (55)
- January, 2004 (63)
- December, 2003 (46)
- November, 2003 (63)
- October, 2003 (92)
- September, 2003 (61)
- August, 2003 (93)
- July, 2003 (57)
- May, 2003 (5)
- April, 2003 (35)
- March, 2003 (35)
- February, 2003 (37)
- January, 2003 (62)
- December, 2002 (32)
This page was last modified on 2004-06-27T19:15:08+09:00 (in 0.099 secs).