From f9ce5dd6c38ecbe1cd93af780a97e96e17a0ead4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 22 Apr 2008 20:23:54 -0500 Subject: [PATCH] Fix RSS2.0 support --- extra/rss/rss.factor | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/extra/rss/rss.factor b/extra/rss/rss.factor index 2e735d2f06..5fc688967a 100644 --- a/extra/rss/rss.factor +++ b/extra/rss/rss.factor @@ -23,7 +23,7 @@ C: entry [ "link" tag-named children>string ] keep [ "description" tag-named children>string ] keep f "date" "http://purl.org/dc/elements/1.1/" - tag-named dup [ children>string rfc3339>timestamp ] when + tag-named dup [ children>string rfc822>timestamp ] when ; : rss1.0 ( xml -- feed ) @@ -39,7 +39,7 @@ C: entry [ "link" tag-named ] keep [ "guid" tag-named dupd ? children>string ] keep [ "description" tag-named children>string ] keep - "pubDate" tag-named children>string rfc3339>timestamp ; + "pubDate" tag-named children>string rfc822>timestamp ; : rss2.0 ( xml -- feed ) "channel" tag-named @@ -71,16 +71,12 @@ C: entry { "feed" [ atom1.0 ] } } case ; -: read-feed ( stream -- feed ) - [ read-xml ] with-html-entities xml>feed ; +: read-feed ( string -- feed ) + [ string>xml xml>feed ] with-html-entities ; : download-feed ( url -- feed ) #! Retrieve an news syndication file, return as a feed tuple. - http-get-stream swap code>> success? [ - read-feed - ] [ - dispose "Error retrieving newsfeed file" throw - ] if ; + http-get read-feed ; ! Atom generation : simple-tag, ( content name -- )