Fix RSS
parent
4235715af9
commit
53c8299576
|
@ -1,4 +1,5 @@
|
||||||
USING: rss io kernel io.files tools.test io.encodings.utf8 ;
|
USING: rss io kernel io.files tools.test io.encodings.utf8
|
||||||
|
calendar ;
|
||||||
IN: rss.tests
|
IN: rss.tests
|
||||||
|
|
||||||
: load-news-file ( filename -- feed )
|
: load-news-file ( filename -- feed )
|
||||||
|
@ -35,7 +36,7 @@ IN: rss.tests
|
||||||
"http://example.org/2005/04/02/atom"
|
"http://example.org/2005/04/02/atom"
|
||||||
"\n <div xmlns=\"http://www.w3.org/1999/xhtml\">\n <p><i>[Update: The Atom draft is finished.]</i></p>\n </div>\n "
|
"\n <div xmlns=\"http://www.w3.org/1999/xhtml\">\n <p><i>[Update: The Atom draft is finished.]</i></p>\n </div>\n "
|
||||||
|
|
||||||
"2003-12-13T08:29:29-04:00"
|
T{ timestamp f 2003 12 13 8 29 29 -4 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ] [ "extra/rss/atom.xml" resource-path load-news-file ] unit-test
|
} ] [ "extra/rss/atom.xml" resource-path load-news-file ] unit-test
|
||||||
|
|
|
@ -7,9 +7,6 @@ USING: xml.utilities kernel assocs xml.generator
|
||||||
http.client namespaces xml.generator hashtables
|
http.client namespaces xml.generator hashtables
|
||||||
calendar.format accessors continuations ;
|
calendar.format accessors continuations ;
|
||||||
|
|
||||||
: ?children>string ( tag/f -- string/f )
|
|
||||||
[ children>string ] [ f ] if* ;
|
|
||||||
|
|
||||||
: any-tag-named ( tag names -- tag-inside )
|
: any-tag-named ( tag names -- tag-inside )
|
||||||
f -rot [ tag-named nip dup ] with find 2drop ;
|
f -rot [ tag-named nip dup ] with find 2drop ;
|
||||||
|
|
||||||
|
@ -26,7 +23,7 @@ C: <entry> entry
|
||||||
[ "link" tag-named children>string ] keep
|
[ "link" tag-named children>string ] keep
|
||||||
[ "description" tag-named children>string ] keep
|
[ "description" tag-named children>string ] keep
|
||||||
f "date" "http://purl.org/dc/elements/1.1/" <name>
|
f "date" "http://purl.org/dc/elements/1.1/" <name>
|
||||||
tag-named ?children>string rfc3339>timestamp
|
tag-named dup [ children>string rfc3339>timestamp ] when
|
||||||
<entry> ;
|
<entry> ;
|
||||||
|
|
||||||
: rss1.0 ( xml -- feed )
|
: rss1.0 ( xml -- feed )
|
||||||
|
|
Loading…
Reference in New Issue