package river

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type html = Nethtml.document list
type feed =
  1. | Atom of Syndic.Atom.feed
  2. | Rss2 of Syndic.Rss2.channel
  3. | Broken of string
    (*

    The feed is either an Atom or Rss2. If the feed is Broken message, then the message gives the reason.

    *)
type contributor = {
  1. name : string;
  2. title : string;
  3. url : string;
  4. feed : feed;
}

Feed information.

type post = {
  1. title : string;
  2. date : Syndic.Date.t option;
  3. contributor : contributor;
  4. author : string;
  5. email : string;
  6. desc : html;
}

Each post has a title, author, email and content (desc). The link, if available, points to the location of the original post.

val get_posts : ?n:int -> ?ofs:int -> string -> post list

get_posts n ofs fname fetches a deduplicated list of posts, sorted based on the date, with the lastest post appearing first. The optional argument n fetches the first n posts. By default, all the posts are fetched. ofs represents the offset into the post list. For example, get_posts 10 10 fetches the posts 10 to 20.

fname is the input file with the list of feeds. The format is:

<feed_name>|<feed_url> <feed_name>|<feed_url> ...

val prefix_of_html : html -> int -> html

prefix_of_html html n truncates the given document to n characters. The truncated document is ensured to be a well-formed docuemnt.

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

mk_entries posts creates a list of atom entries, which can then be used to create an atom feed that is an aggregate of the posts.