Did you know ... | Search Documentation: |
Pack atom_feed -- prolog/atom_feed.pl |
stream(Stream)
- an input streamfile(File)
- a file name to read fromatom(Atom)
- Atom or RSS XML in an atomcodes(Codes)
- Atom or RSS XML in a list of codesurl(Url)
- a URL to fetchThis is the first step in working with an Atom or RSS feed. If an RSS feed has multiple channels, only the first channel is considered.
type
or src
attributes.It's not possible to reliably extract summaries from RSS entries. That's because summary and content is confounded into a single 'description' element.
For example, to find the URL to an HTML alternative:
link(Feed, Link), rel(Link, alternate), type(Link, text/html), href(Link, Url).
alternate
is used
instead. That's why this predicate's mode is det
.
Because RSS links can't specify a 'rel', we use alternate
for them
too.
Type/Subtype
which allows one to do things like
type(Link, text/_) % link has a textual type
The Atom spec says that 'type' is optional. If it's missing, this
predicate fails. RSS spec says the link points to "the HTML website",
so MediaType is always text/html
.
Subtype may contain punctuation so remember to quote:
application/'atom+xml'
.