February 01, 2005
MT 防止垃圾的 Trackback 的方法::[Source]

以前做防止Spam comment垃圾留言的时候做了,长时间没有看都忘记了,朋友问起提醒了我,写在这里:
mt-tb.cgi 是处理 trackback 的程序,这个程序拿到了 trackback 后进行插入数据库处理。
trackback 的数据结构定义在:
lib/MT/TBPing.pm 里面,有如下结构:
my $ping = MT::TBPing->new;
$ping->blog_id($tb->blog_id);
$ping->tb_id($tb->id);
$ping->title('Foo');
$ping->excerpt('This is from a TrackBack ping.');
$ping->source_url('http://www.foo.com/bar');
$ping->save
or die $ping->errstr;
其中 'excerpt'就是文字描述部分,可以进行监查有没有中文的判断,如果没有中文,就当做spam处理,直接中断:
if ($ENV{'REQUEST_METHOD'} eq "POST") {
my $tck = param('excerpt');
die if($tck ne "" && $tck !~ /[\x80-\xff]/);
}
将以上四句话加到 mt-tb.cgi 里面 use strict; 后就应该起作用了。
Trackback
You can ping this entry by using http://www.wespoke.com/cgi-bin/mt/mt-tb.cgi/708
邮箱里一下子收到十几封来自这个blog的trackback的通知邮件,吓了我一跳...
Trackbacked from http://www.cathome01.com/asiapan/archives/2005/02/trackback.html with 是trackback被攻击吗? on Asiapan.
Trackbacked from http://www.juega-al-casino.com with Great post! I'm looking forward for more. on .
Trackbacked from http://babylinda.blogchina.com/4860334.html with on ̻.
Comments
谢谢卢亮,我最近发现Google Groups实际上是一个非常好的个人留言簿系统,我已经将将大部分MT邮件都转发到@googlegroups.com 上建立的邮件列表中了,实现了一个个人通用的留言簿机制。可以用来跟踪被人给自己BLOG的反馈和自己在别人BLOG上的留言回复。
车东
Posted by: Che Dong at February 2, 2005 12:46 AM from 202.43.217.195不客气, 我也发现 google 的很多东西可以拿来做比较有意思的东西.
Posted by: 6e at February 2, 2005 06:21 PM from 129.119.200.36both didn't work with MT 3.0D
文
Posted by: kevin at February 20, 2005 02:44 PM from 129.119.200.36The first stage of a 150m investment in regional museums is praised for boosting visitor numbers...
Posted by: Nico Hoover at December 7, 2006 08:33 PM from 62.150.35.230The first stage of a 150m investment in regional museums is praised for boosting visitor numbers...
Posted by: Nico Hoover at December 7, 2006 08:34 PM from 12.177.23.134The first stage of a 150m investment in regional museums is praised for boosting visitor numbers...
Posted by: Bryant Broadnax at December 14, 2006 09:10 AM from 82.137.247.132The first stage of a 150m investment in regional museums is praised for boosting visitor numbers...
Posted by: Bryant Broadnax at December 14, 2006 09:11 AM from 62.220.102.82Hello, nice site look this:
leccami minchia [url=http://ira.italyfinance.org/leccami-minchia.html]leccami minchia[/url]
la madre di ungaretti [url=http://ira.italyfinance.org/la-madre-di-ungaretti.html]la madre di ungaretti[/url]
minchia culo gratis [url=http://ira.italyfinance.org/minchia-culo-gratis.html]minchia culo gratis[/url]
soft leather handbags [url=http://ira.italyfinance.org/soft-leather-handbags.html]soft leather handbags[/url]
End ^) See you
Posted by: Ariel at January 15, 2007 02:59 AM from 83.181.202.251Hello, look this:
[url=http://anxiety-propranolol.ultra-herbal.org/exam/irritability.html]exam irritability[/url] exam irritability
My life's been generally bland today. I just don't have anything to say recently. I guess it doesn't bother me. Basically nothing seems worth doing, but I don't care.
People should be allowed to go naked in certain recreational areas only - Or specify those areas and you have another persuasive speech topic
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
Wann machma denn die nchste party??? lebe lang und erfolgreich!!! :)
DdgUbs First of all, theres no one else like YOUyour story is unique and you can tell about people, times, and places that only YOU can share.
Why not tell your grandchildren about you.plus their grandparents, great-grandparents, and even their great-great grandparents (thats
your grandparents)! Its really about creating a loving, lasting bondpreserving not just life stories, but relationships, for
generations to come.
Of course, you can also give them your own advice about love, work, and how to lead a good life. Here was my grandmas advice to me: Be
what you want. If you do something, do it the best you can. Because its my grandma, it means so much more. Ill always be able to
remember what she said because it was actually written down. Whats your advice for your family? This is your opportunity to write it
down.
Reminiscing is good for you too! Over 100 studies over the last 10 years have found that reminiscing lowers depression, alleviates
physical symptoms (arthritis, asthma), and stimulates the hippocampus where memories are stored in the brain. So consider the great
health reasons for reminiscing too.
Posted by: Beth Sanders at July 19, 2007 12:40 AM from 24.184.8.253replica watches
[url=http://issues.apache.org/bugzilla/attachment.cgi?id=20597]replica watches[/url]
big pussy
[url=http://issues.apache.org/bugzilla/attachment.cgi?id=20594]big pussy[/url]
Rolex Watches
[url=http://issues.apache.org/bugzilla/attachment.cgi?id=20595]Rolex Watches[/url]
Al consumo critico antiracket lOscar della partecipazione civica
I grandi vecchi delle dittature mondiali si spengono. Fidel grave e ieri morto Pinochet, ironia della sorte nella
