This is a read-only archive!

Anti-spam field still holding

So far my silly anti-spam measures are working. Since last week I've had 1861 spam comment attempts, of which 0 were successful. 1857 of them didn't even alter the text my the captcha text field at all. Four of them inexplicably HTML-escaped the < into a &lt;.

One feature I didn't implement from Wordpress is subscribing to comments via email. Sending an email from Java is possible but a little bit painful to implement. The Javamail API is a monster.

I do think it's useful to be able to know when someone responds to comment you left, but is spamming your inbox really the best way? I have to think there's a better way.

I did implement an RSS feed for each individual post's comments. And separate RSS feeds for all the tags on my blog, and all the categories. When RSS feeds are generated dynamically, why not? This is all of the code for the tag feeds:

(defn tag-rss [tagname]
  (if-let [tag (get-tag tagname)]
    (rss
        (str "briancarper.net Tag: " (:name tag))
        (str "http://briancarper.net/" (:url tag))
        "briancarper.net"
        (map rss-item (take 25 (all-posts-with-tag tag))))
    (error-404 )))

Plus the routing code:

(GET "/feed/tag/:name" (tag-rss (route :name)))

But I haven't uploaded the comment-feed feature because I don't know if it's overkill. Personally I am liberal with my RSS feeds, I just pop them into my Akregator and off I go. But I don't know if other people take their feeds more seriously, or what. RSS feeds can be a bit heavyweight. Maybe I should make a feed for all of my comments across all posts.

This post is related to Darn you, spammers.
March 23, 2009 @ 12:38 PM PDT
Cateogory: Programming

2 Comments

Jeff
Quoth Jeff on May 05, 2009 @ 2:14 AM PDT

I needed a little mailer also, so if you want a one function mail library it might come in handy:

http://github.com/rosejn/clj-libs/blob/6918688831f87eb83f4e756af37ad48673742092/mailer.clj

It lets you do this:

(def smtp-config {:server "smtp.gmail.com" :login "me@gmail.com" :password "my-password" :tls true})

(send-mail smtp-config {:to "alan.turing@computer.com" :from "me@gmail.com" :subject "Hey Al!" :body "So I was thinking about that machine you were talking about..."})

Brian
Quoth Brian on May 05, 2009 @ 6:17 AM PDT

Awesome, I'll have to check that out. That code looks a lot less formidable than I'd have predicted. I used Javamail directly for a different library to do some IMAP stuff and the API is over-engineered and bloated beyond belief. Apache Commons code seems to be pretty good quality most of the time, I'll have to look there first next time. Did Alan Turing ever reply?