Re: how to disable trackback?

Ben Osman <ben.nospam-To4I4uWENgvqlBn2x/[email protected]> Mon, 12 Jun 2006 12:37:30 +0200
Newsgroups gmane.comp.python.zope.coreblog.english
Message-ID <[email protected]>
Atsushi Shibata wrote:
> Hi :-).
> 
> How about customizing "portal_skins/coreblog2/tbping" ?

> Put floowing code after if block, so you can avoid trackback including 
> "buzz words" string.
> 
> if excerpt.lower().find("buzz words") == -1:
>     return
> 
> If you use Python 2.3, you can also write like this.
> 
> if "buzz words" in excerpt.lower():
>     return
> 
> I think you should learn more about Python ;-).
> 
> Have fun :-)
> 

I've been getting spam too - so i used Atsushi's suggestion and extended 
it. Ideally should load the spamwords list from another file.

You should add more words to the list (do a search for something like 
trackback spam word list)

In "portal_skins/coreblog2/tbping" add following code after
"excerpt = cbtool.convert_charcode(excerpt)":

spamWords = [
'casino',
'prilosec',
'viagra',
]

words = excerpt.split(' ')

for word in words:
   if word.lower() in spamWords:
     return




_______________________________________________
COREblog-en mailing list
COREblog-en-/9qXvnWia/9Wk0Htik3J/[email protected]
http://postaria.com/mailman/listinfo/coreblog-en
Unsubscription writing to coreblog-en-leave-/9qXvnWia/9Wk0Htik3J/[email protected]