aboutsummaryrefslogtreecommitdiff
path: root/lib/post.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/post.ml')
-rw-r--r--lib/post.ml28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/post.ml b/lib/post.ml
index 5c3d494..dbca936 100644
--- a/lib/post.ml
+++ b/lib/post.ml
@@ -48,7 +48,11 @@ type mastodon_tag = {
}
[@@deriving yojson] [@@yojson.allow_extra_fields]
-type mastodon_object = { tag : mastodon_tag list; url : string }
+type mastodon_object = {
+ tag : mastodon_tag list;
+ url : string;
+ content : string;
+}
[@@deriving yojson] [@@yojson.allow_extra_fields]
type mastodon_post = {
@@ -61,7 +65,7 @@ type mastodon_post = {
let mastodon_actor post = post.actor
let post_of_mastodon_post actor_name = function
- | { published; obj = { tag; url }; _ } ->
+ | { published; obj = { tag; url; content }; _ } ->
let tags =
List.filter_map
(fun { name; kind; _ } ->
@@ -70,18 +74,14 @@ let post_of_mastodon_post actor_name = function
if kind = "Hashtag" then Some name else None)
tag
in
- { link = url; summary = published; tags; published; author = actor_name }
+ {
+ link = url;
+ summary = content;
+ tags;
+ published;
+ author = actor_name;
+ author_link = url;
+ }
let get_tld (link : string) =
Uri.of_string link |> Uri.host_with_default ~default:""
-
-let db = ref []
-
-let add (entry : t) =
- db := entry :: !db;
- print_endline (entry.link ^ " added to db");
- print_endline ("New db size: " ^ string_of_int (List.length !db))
-
-let get_all () =
- print_endline ("db size: " ^ string_of_int (List.length !db));
- !db