package river

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type source = {
  1. name : string;
  2. url : string;
}

The source of a feed.

type feed
type post
val fetch : source -> feed

fetch source returns an Atom or RSS feed from a source.

val name : feed -> string

name feed is the name of the feed source passed to fetch.

val url : feed -> string

url feed is the url of the feed source passed to fetch.

val posts : feed list -> post list

posts feeds is the list of deduplicated posts of the given feeds.

val feed : post -> feed

feed post is the feed the post originates from.

val title : post -> string

title post is the title of the post.

link post is the link of the post.

val date : post -> Syndic.Date.t option

date post is the date of the post.

val author : post -> string

author post is the author of the post.

val email : post -> string

email post is the email of the post.

val content : post -> string

content post is the content of the post.

val meta_description : post -> string option

meta_description post is the meta description of the post on the origin site.

To get the meta description, we make get the content of link post and look for an HTML meta tag with the name "description" or "og:description".

val seo_image : post -> string option

seo_image 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".

val create_atom_entries : post list -> Syndic.Atom.entry list

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.