/extra/webapps/irc-log/irc-log.factor

http://github.com/abeaumont/factor · Factor · 22 lines · 16 code · 4 blank · 2 comment · 0 complexity · 179fe72d94a45d68112a3234402e12b2 MD5 · raw file

  1. ! Copyright (C) 2008 Doug Coleman.
  2. ! See http://factorcode.org/license.txt for BSD license.
  3. USING: calendar kernel http.server.dispatchers prettyprint
  4. sequences formatting furnace.actions html.forms accessors
  5. furnace.redirection ;
  6. IN: webapps.irc-log
  7. TUPLE: irclog-app < dispatcher ;
  8. : irc-link ( channel -- string )
  9. gmt -7 hours convert-timezone >date<
  10. [ unparse 2 tail ] 2dip
  11. "http://bespin.org/~nef/logs/%s/%02s.%02d.%02d"
  12. sprintf ;
  13. : <display-irclog-action> ( -- action )
  14. <action>
  15. [ "concatenative" irc-link <redirect> ] >>display ;
  16. : <irclog-app> ( -- dispatcher )
  17. irclog-app new-dispatcher
  18. <display-irclog-action> "" add-responder ;