package river
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=0500da466b93aa356f9dabc2550a34ea
sha512=59c3663a156fa767217e6a50361b51d9582c357a479ffa22bffe76c71a770fb812e6c2787a45cae0aa2522bbabe571640861da739f9672aeccabd9514b780b24
doc/river/River/index.html
Module RiverSource
The source of a feed.
fetch ?timeout ?user_agent ?repair source returns an Atom or RSS feed from a source.
of_string ?repair source xml parses the in-memory feed document xml as if it had been fetched from source.url, performing no HTTP request. See fetch for repair.
sanitize_void_elements xml rewrites HTML void elements (<img>, <br>, …) into self-closing form: both unclosed (<img ...>) and redundantly-closed (<img ...></img>) occurrences become <img ... />. Already self-closed elements and escaped (type="html") content are left untouched. This is the transform applied by fetch and of_string when ~repair:true; it is exposed for testing and reuse.
repair_missing_updated xml fills in a mandatory entry-level <updated> element wherever an Atom <entry> lacks one, defaulting it to (1) the entry's own <published> if present, else (2) the feed-level <updated>. Entries that already have an <updated> and documents with no <entry> (e.g. RSS2) are left unchanged, so it is idempotent and never alters a valid feed. This is the second transform applied by fetch and of_string when ~repair:true; it is exposed for testing and reuse.
posts feeds is the list of deduplicated posts of the given feeds.
date post is the date of the post.
summary post is the short description provided by the feed itself: the Atom <summary> or the RSS2 <description>, as plain text. None when the feed provides no such element.
meta_description ?timeout ?user_agent post is a short description of the post.
When the feed provides one, summary post is returned directly. Otherwise we fetch the content of link post and look for an HTML meta tag with the name "description" or "og:description".
seo_image ?timeout ?user_agent post is the image to be used by social networks and links to the post.
To get the seo image, we make get the content of link post and look for an HTML meta tag with the name "og:image" or "twitter:image".
create_atom_feed posts creates a list of atom entries, which can then be used to create an atom feed that is an aggregate of the posts.