syndication: Property can be present but f, handle this.
Test case: "http://www.spreaker.com/show/2952221/episodes/feed" http-get nip parse-feedflac
parent
b5050a0418
commit
4520c7c110
|
@ -26,6 +26,9 @@ TUPLE: entry title url description date ;
|
||||||
: try-parsing-timestamp ( string -- timestamp )
|
: try-parsing-timestamp ( string -- timestamp )
|
||||||
[ rfc822>timestamp ] [ drop rfc3339>timestamp ] recover ;
|
[ rfc822>timestamp ] [ drop rfc3339>timestamp ] recover ;
|
||||||
|
|
||||||
|
: ?children>string ( tag -- str/f )
|
||||||
|
dup [ children>string ] when ; inline
|
||||||
|
|
||||||
: rss1.0-entry ( tag -- entry )
|
: rss1.0-entry ( tag -- entry )
|
||||||
<entry> swap {
|
<entry> swap {
|
||||||
[ "title" tag-named children>string >>title ]
|
[ "title" tag-named children>string >>title ]
|
||||||
|
@ -47,12 +50,12 @@ TUPLE: entry title url description date ;
|
||||||
|
|
||||||
: rss2.0-entry ( tag -- entry )
|
: rss2.0-entry ( tag -- entry )
|
||||||
<entry> swap {
|
<entry> swap {
|
||||||
[ "title" tag-named children>string >>title ]
|
[ "title" tag-named ?children>string >>title ]
|
||||||
[ { "link" "guid" } any-tag-named children>string >url >>url ]
|
[ { "link" "guid" } any-tag-named ?children>string >url >>url ]
|
||||||
[ { "description" "encoded" } any-tag-named children>string >>description ]
|
[ { "description" "encoded" } any-tag-named ?children>string >>description ]
|
||||||
[
|
[
|
||||||
{ "date" "pubDate" } any-tag-named
|
{ "date" "pubDate" } any-tag-named
|
||||||
children>string try-parsing-timestamp >>date
|
?children>string try-parsing-timestamp >>date
|
||||||
]
|
]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue