comments, trackback, check_javascript, tb_spamプラグイン導入
posted by jun-g at Mon, 18 Dec 2006 03:24 JST
ようやく導入してみた。わくわく。trackbackプラグインの修正に合わせて、tb_spamプラグインも以下の通り修正してから導入した。
--- tb_spam.py.orig Mon Dec 18 02:59:37 2006 +++ tb_spam.py Mon Dec 18 03:09:12 2006 @@ -11,25 +11,20 @@ __VERSION__ = '0.1' __LICENSE__ = 'BSD license' -def cb_comment_reject(args): +def cb_trackback_reject(args): request = args['request'] comment = args['comment'] - if comment.has_key('trackback'): - import urllib - - config = request.getConfiguration() - my_url = config['base_url'] - if (comment.has_key('link')): - f = urllib.urlopen(comment['link']) - content = f.read() - f.close() - - if content.find(my_url) == -1: - return True - else: - return False - else: + import urllib + config = request.getConfiguration() + my_url = config['base_url'] + if comment.has_key('link'): + f = urllib.urlopen(comment['link']) + content = f.read() + f.close() + if content.find(my_url) == -1: return True - + else: + return False else: return False
上手く動きますように!!