My agentic slop goes here. Not intended for anyone else!
at main 2.4 kB view raw
1(* 2 * Copyright (c) 2014, OCaml.org project 3 * Copyright (c) 2015 KC Sivaramakrishnan <sk826@cl.cam.ac.uk> 4 * 5 * Permission to use, copy, modify, and distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 *) 17 18(** Post representation and extraction from feeds. *) 19 20type t 21(** A post from a feed. *) 22 23val of_feeds : Feed.t list -> t list 24(** [of_feeds feeds] extracts and deduplicates posts from the given feeds. 25 26 Posts are deduplicated by ID. *) 27 28val feed : t -> Feed.t 29(** [feed post] returns the feed this post originated from. *) 30 31val title : t -> string 32(** [title post] returns the post title. *) 33 34val link : t -> Uri.t option 35(** [link post] returns the post link. *) 36 37val date : t -> Syndic.Date.t option 38(** [date post] returns the post date. *) 39 40val author : t -> string 41(** [author post] returns the post author name. *) 42 43val email : t -> string 44(** [email post] returns the post author email. *) 45 46val content : t -> string 47(** [content post] returns the post content. *) 48 49val id : t -> string 50(** [id post] returns the unique identifier of the post. *) 51 52val tags : t -> string list 53(** [tags post] returns the list of tags associated with the post. *) 54 55val summary : t -> string option 56(** [summary post] returns the summary/excerpt of the post, if available. *) 57 58val meta_description : t -> string option 59(** [meta_description post] returns the meta description from the origin site. 60 61 To get the meta description, we fetch the content of [link post] and look 62 for an HTML meta tag with name "description" or "og:description". *) 63 64val seo_image : t -> string option 65(** [seo_image post] returns the social media image URL. 66 67 To get the SEO image, we fetch the content of [link post] and look for an 68 HTML meta tag with name "og:image" or "twitter:image". *)