Welcome to the CHICKEN Scheme pasting service

vandusen-memelog pasted by evhan on Tue Oct 4 23:59:05 2011

(module vandusen-memelog ()
  (import scheme chicken posix regex)
  (use vandusen irc)

(plugin 'memelog
  (lambda ()

    (define oflags (+ open/wronly open/append open/creat))

    (message-handler (lambda (m)
                       (let ((m (irc:message-body m)))
                         (cond ((string-search "http://www.quickmeme.com/meme/.*" m) =>
                                (lambda (lst)
                                  (condition-case
                                    (and-let* ((file ($ 'memelog))
                                               (fd (file-open file oflags)))
                                      (file-write fd (format "~a\n" (car lst)))
                                      (file-close fd))
                                  (exn () (debug "CRITICAL COULDN'T WRITE TO MEMELOG!!eleven!"))))))
                         #f))
                     command: "PRIVMSG"))))

for posterity ;) added by evhan on Wed Oct 5 06:36:04 2011

"http://www.quickmeme.com/meme/[[:alnum:]]*/?" ; (¬_¬)

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What does `(string? 42)' produce?
Visually impaired? Let me spell it for you (wav file) download WAV