Paste: new atom feed generation code

Author: LittleDan
Mode: factor
Date: Mon, 26 Jan 2009 05:56:34
Plain Text |
: entry>xml ( entry -- xml )
    {               [ title>> ]
        [ url>> present ]
        [ date>> timestamp>rfc3339 ]
        [ description>> ]
    } cleave
    [XML
        <entry> 
            <title type="html"><-></title>
            <link href=<-> />
            <published><-></published>
            <content type="html"><-></content>
        </entry>
    XML] ;  
            
: feed>xml ( feed -- xml )
    [ title>> ] [ url>> present ] [ entries>> [ entry>xml ] map ] tri
    <XML
        <feed xmlns="http://www.w3.org/2005/Atom">
            <title><-></title>
            <link href=<-> />
            <-> 
        </feed>
    XML> ;

Annotation: locals version

Author: LittleDan
Mode: factor
Date: Mon, 26 Jan 2009 06:01:05
Plain Text |
:: feed>xml ( feed -- xml )
    feed title>> :> title
    feed url>> present :> url
    feed entries>> [ entry>xml ] map :> entries
    <XML
        <feed xmlns="http://www.w3.org/2005/Atom">
            <title><-title-></title>
            <link href=<-url-> />
            <-entries-> 
        </feed>
    XML> ;

New Annotation

Summary:
Author:
Mode:
Body: