aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Coquand <marcc@fastmail.fr>2023-12-02 11:28:42 -0600
committerMarc Coquand <marcc@fastmail.fr>2023-12-02 11:28:42 -0600
commit581f3332876a90a0df7a202070e3f7ae9b371fba (patch)
tree4a9958dbecd009d28b418b2b7c33b738daeb30d7
parent189179574d847e8e9662cf78804ce9371fac988d (diff)
downloadwormhole-581f3332876a90a0df7a202070e3f7ae9b371fba.tar.gz
wormhole-581f3332876a90a0df7a202070e3f7ae9b371fba.tar.bz2
wormhole-581f3332876a90a0df7a202070e3f7ae9b371fba.zip
Fix build dep, use post url
-rw-r--r--Dockerfile2
-rw-r--r--lib/post.ml12
2 files changed, 4 insertions, 10 deletions
diff --git a/Dockerfile b/Dockerfile
index f230a65..97b03f5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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:""