Since I am in the process of learning erlang, I figured that I might as well try to use the blogspam.net service, using the xmlrpc erlang libary (I can’t find a homepage for the project).
The implementation is pretty straightforward, and to try it out, get the source here.
It depends on two erlang libaries, xmerl (which should be installed as default) and xmlrpc.
Usage:
To test if a comment is spam or not, do this:
> antispammerl:is_spam("Is this comment spam?","91.193.130.226"). "OK"
Meaning that this comment is okay.
Alternatively, you can pass a list instead, useful if you want to include aditional parameters:
> antispammerl:is_spam([{comment,"Is this comment spam?"},{ip,"91.193.130.226"},{options,"exclude=dnsrbl"}]). "OK"
The option given means that the ip-address the comment is originating from will not be checked in various blacklists.
Introducing antispammerl
Since I am in the process of learning erlang, I figured that I might as well try to use the blogspam.net service, using the xmlrpc erlang libary (I can’t find a homepage for the project).
The implementation is pretty straightforward, and to try it out, get the source here.
It depends on two erlang libaries, xmerl (which should be installed as default) and xmlrpc.
Usage:
To test if a comment is spam or not, do this:
> antispammerl:is_spam("Is this comment spam?","91.193.130.226")."OK"
Meaning that this comment is okay.
Alternatively, you can pass a list instead, useful if you want to include aditional parameters:
> antispammerl:is_spam([{comment,"Is this comment spam?"},{ip,"91.193.130.226"},{options,"exclude=dnsrbl"}])."OK"
The option given means that the ip-address the comment is originating from will not be checked in various blacklists.
To get a list of plugins:
> antispammerl:get_plugins().["00blacklist","00whitelist","badip","bayasian","bogusip",
"dnsrbl","dropme","emailtests","lotsaurls","requiremx",
"sfs","size","stopwords","surbl","wordcount"]
To get stats for a website:
> antispammerl:get_stats("http://blog.bredsaal.dk").[{ok,1},{spam,21}]
Meaning that my blog is getting spammed pretty bad
.
Finally, to train the spamfilter:
This comment is clearly spam, so we tell that to the spamfilter using the spam atom.
> antispammerl:classifycomment("anisate ponderal protestatory coloptosis doronicum symmelian unfoaled whissle Phoenix Online http://www.talentteacher.com/",spam).ok
And now a comment that is not spam:
> antispammerl:classifycomment("Wow this looks great. Erlang rocks.",ok).ok
If you use it, please let me know. Any comments is welcome (as long as it’s not spam
).
Related posts:
Tags: antispam, commentspam, erlang