Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / extra / webapps / irc-log / irc-log.factor
blobbd9843bdc94aa766f191f92a045ccb59f2abd0b6
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
8 TUPLE: irclog-app < dispatcher ;
10 : irc-link ( -- string )   
11     gmt -7 hours convert-timezone >date<
12     [ unparse 2 tail ] 2dip
13     "http://bespin.org/~nef/logs/concatenative/%02s.%02d.%02d"
14     sprintf ;
15     
16 : <display-irclog-action> ( -- action )
17     <action>
18         [ irc-link <redirect> ] >>display ;
20 : <irclog-app> ( -- dispatcher )
21     irclog-app new-dispatcher
22         <display-irclog-action> "" add-responder ;