! Copyright (C) 2006 Chris Double, Daniel Ehrenberg.
! Portions copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: xml.traversal kernel assocs math.order strings sequences
-xml.data xml.writer io.streams.string combinators xml
-xml.entities.html io.files io http.client namespaces make
-xml.syntax hashtables calendar.format calendar.parser accessors
-continuations urls present byte-arrays ;
+USING: accessors byte-arrays calendar.format calendar.parser
+combinators combinators.short-circuit continuations http.client
+kernel present sequences strings urls xml xml.data
+xml.entities.html xml.syntax xml.traversal xml.writer ;
IN: syndication
: any-tag-named ( tag names -- tag-inside )
[ "item" tags-named [ rss2.0-entry ] map set-entries ]
tri ;
+ERROR: invalid-atom-link ;
+
: atom-link ( tag -- url/f )
- "link" "alternate" "rel" tag-named-with-attr
+ {
+ [ "link" "alternate" "rel" tag-named-with-attr ]
+ [ "link" "self" "rel" tag-named-with-attr ]
+ [ "link" tag-named ]
+ } 1||
[ "href" attr >url ] [ f ] if* ;
: atom1.0-entry ( tag -- entry )