PageRenderTime 13ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

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