aboutsummaryrefslogtreecommitdiff
path: root/lib/post.mli
blob: 9bf32ae6874df463a83f28a96861c51c25398ed5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
type t = {
  link : string;
  summary : string;
  tags : string list;
  published : string;
  author : string;
}

type mastodon_tag = { kind : string; name : string; href : string }

val mastodon_tag_of_yojson : Yojson.Safe.t -> mastodon_tag
val yojson_of_mastodon_tag : mastodon_tag -> Yojson.Safe.t

type mastodon_object = { tag : mastodon_tag list }

val mastodon_object_of_yojson : Yojson.Safe.t -> mastodon_object
val yojson_of_mastodon_object : mastodon_object -> Yojson.Safe.t

type mastodon_post = {
  actor : string;
  published : string;
  obj : mastodon_object;
}

val mastodon_post_of_yojson : Yojson.Safe.t -> mastodon_post
val yojson_of_mastodon_post : mastodon_post -> Yojson.Safe.t
val post_of_mastodon_post : mastodon_post -> t
val get_tld : string -> string
val db : t list ref
val add : t -> unit
val get_all : unit -> t list