package calculon-web

  1. Overview
  2. Docs

These data-structures are for holding meta-data expressed by the open graph protocol.

The basic information represented is the site name, title, content type, canonical url and a preview image. If the content is music or video data, additional data, additional data like tags or length may be present. Even though the protocal requires a minimum information of title, type, image and url, the webpage might be malformed. Parse.parse_string therefore just returns a list of og_metadata.

type url = {
  1. name : string;
}
type locale = {
  1. language : string;
  2. territory : string;
}
type og_type =
  1. | TMusic
  2. | TVideo
  3. | TWebsite
  4. | TArticle
  5. | TBook
  6. | TProfile
  7. | TOther of string
type og_determiner =
  1. | A
  2. | An
  3. | The
  4. | NoDet
  5. | Auto
type og_video_metadata =
  1. | VTag of string
  2. | VDuration of int
type og_metadata =
  1. | Title of string
  2. | Type of og_type
  3. | Image of url
  4. | Url of url
  5. | Audio of url
  6. | Description of string
  7. | Determiner of og_determiner
  8. | Locale of locale
  9. | AlternateLocale of locale
  10. | SiteName of string
  11. | Video of url
  12. | VideoMeta of og_video_metadata
  13. | UnparsedMeta of string
type basic_metadata = {
  1. og_title : string;
  2. og_type : og_type;
  3. og_image : url;
  4. og_url : url;
}
val parse_url : string -> url option
val parse_locale : string -> locale option
val parse_type : string -> og_type
val make_title : string -> og_metadata
val make_type : og_type -> og_metadata
val make_image : url -> og_metadata
val make_audio : url -> og_metadata
val make_description : string -> og_metadata
val make_determiner : og_determiner -> og_metadata
val make_locale : locale -> og_metadata
val make_alternate_locale : locale -> og_metadata
val make_site_name : string -> og_metadata
val make_video : url -> og_metadata
val make_video_metadata : og_video_metadata -> og_metadata
val make_url : url -> og_metadata
val make_video_tag : string -> og_video_metadata
val make_video_duration : int -> og_video_metadata
val format_metadata : Stdlib.Format.formatter -> og_metadata -> unit
module Parser : sig ... end