diff options
Diffstat (limited to '')
-rw-r--r-- | Dockerfile | 2 | ||||
-rw-r--r-- | lib/post.ml | 12 |
2 files changed, 4 insertions, 10 deletions
@@ -1,7 +1,7 @@ FROM ocaml/opam:alpine as build # Install system dependencies -RUN sudo apk add --update libev-dev openssl-dev +RUN sudo apk add --update libev-dev openssl-dev gmp-dev WORKDIR /home/opam # Install dependencies diff --git a/lib/post.ml b/lib/post.ml index 3b63a11..744e296 100644 --- a/lib/post.ml +++ b/lib/post.ml @@ -15,7 +15,7 @@ type mastodon_tag = { } [@@deriving yojson] [@@yojson.allow_extra_fields] -type mastodon_object = { tag : mastodon_tag list } +type mastodon_object = { tag : mastodon_tag list; url : string } [@@deriving yojson] [@@yojson.allow_extra_fields] type mastodon_post = { @@ -28,7 +28,7 @@ type mastodon_post = { let mastodon_actor post = post.actor let post_of_mastodon_post actor_name = function - | { actor; published; obj = { tag } } -> + | { published; obj = { tag; url }; _ } -> let tags = List.filter_map (fun { name; kind; _ } -> @@ -37,13 +37,7 @@ let post_of_mastodon_post actor_name = function if kind = "Hashtag" then Some name else None) tag in - { - link = actor; - summary = published; - tags; - published; - author = actor_name; - } + { link = url; summary = published; tags; published; author = actor_name } let get_tld (link : string) = Uri.of_string link |> Uri.host_with_default ~default:"" |