Fix RSS2.0 support
parent
bfa34122f3
commit
f9ce5dd6c3
|
@ -23,7 +23,7 @@ C: <entry> entry
|
|||
[ "link" tag-named children>string ] keep
|
||||
[ "description" tag-named children>string ] keep
|
||||
f "date" "http://purl.org/dc/elements/1.1/" <name>
|
||||
tag-named dup [ children>string rfc3339>timestamp ] when
|
||||
tag-named dup [ children>string rfc822>timestamp ] when
|
||||
<entry> ;
|
||||
|
||||
: rss1.0 ( xml -- feed )
|
||||
|
@ -39,7 +39,7 @@ C: <entry> 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 <entry> ;
|
||||
"pubDate" tag-named children>string rfc822>timestamp <entry> ;
|
||||
|
||||
: rss2.0 ( xml -- feed )
|
||||
"channel" tag-named
|
||||
|
@ -71,16 +71,12 @@ C: <entry> 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 -- )
|
||||
|
|
Loading…
Reference in New Issue