anchor.diff:                                        url)))))
   
   (defun monitor-hacker-news (send)
  +  "Sends the new news message lines by calling the SEND function.
  +Updates the *LAST-STORY* ID."
     (dolist (story (get-new-stories))
       (let ((message (format-story (story story))))
         (when message
  
positive.code: 
  ;;; cf. https://github.com/HackerNews/API
  
  (defvar *period* 10 #|seconds|#)
  (defvar *last-story* nil)
  
  (defun monitor-initialize ()
    (unless (find '("application" . "json") *text-content-types*
                  :test (function equalp))
      (push '("application" . "json") *text-content-types*))
    (setf *last-story* nil))
  
  (defun new-stories ()
    (multiple-value-bind (value status) (http-request "https://hacker-news.firebaseio.com/v0/newstories.json")
      (when (= 200 status)
        (decode-json-from-string value))))
  
  (defun story (id)
    (multiple-value-bind (value status) (http-request (format nil "https://hacker-news.firebaseio.com/v0/item/~A.json" id))
      (when (= 200 status)
        (decode-json-from-string value))))
  
  (defun get-new-stories ()
    (let ((news (new-stories)))
      (if *last-story*
           (reverse (subseq news 0 (or (position *last-story* news) 1)))
          (list (first news)))))
  
  (defun hn-url (story)
    (format nil "https://news.ycombinator.com/item?id=~A" story))
  
  (defun format-story (story)
    (let ((title  (aget story :title))
          (url    (aget story :url))
          (id     (aget story :id)))
  
negative.code: (defpackage "COM.INFORMATIMAGO.SMALL-CL-PGMS.BOTIHN"
    (:use "COMMON-LISP" "CL-IRC" "CL-JSON" "DRAKMA" 
          "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.LIST")
    (:export "MAIN")
    (:documentation "
  Botihn is a simple IRC bot monitoring Hacker News, and writing to
  irc://irc.freenode.org/#hn the title and url of each new news.
  
  It is run with:
  
     (com.informatimago.small-cl-pgms.botihn:main)
  
  Copyright Pascal J. Bourguignon 2015 - 2015
  Licensed under the AGPL3.
  "))
  (in-package "COM.INFORMATIMAGO.SMALL-CL-PGMS.BOTIHN")
  
  
  