syndication: Property can be present but f, handle this.

Test case:
    "http://www.spreaker.com/show/2952221/episodes/feed" http-get nip parse-feed
flac
Doug Coleman 2020-02-18 18:43:49 -06:00 committed by Steve Ayerhart
parent b5050a0418
commit 4520c7c110
No known key found for this signature in database
GPG Key ID: 5BFD39C5359E967D
1 changed files with 7 additions and 4 deletions

View File

@ -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 ;