diff --git a/pleroma-comments.lua b/pleroma-comments.lua index 9581370..2b9d0d5 100644 --- a/pleroma-comments.lua +++ b/pleroma-comments.lua @@ -127,12 +127,6 @@ function combine_tables(a,b) return a end -function get_opening_post(host, post_id) - local url = "https://" .. host .. "/api/v1/statuses" .. post_id - print(url) - local received = get(url) -end - function get_url_from_pandoc_str(pandoc_str) local str = pandoc.utils.stringify(pandoc_str) -- 1 = protocol, 2 = host ... @@ -147,6 +141,12 @@ function get_url_from_pandoc_str(pandoc_str) return link, host, id end +function get_status(host, post_id) + local url = "https://" .. host .. "/api/v1/statuses/" .. post_id + print(url) + return get(url) +end + function get_replies(host, id) local url = "https://" .. host .. "/api/v1/statuses/" .. id .. "/context" print(url) @@ -170,12 +170,10 @@ function Meta(meta) table.insert(hrefs, {link = link, id = id} ) + local op = get_status(host, id) + table.insert(all_replies, op) local replies = get_replies(host, id) - if #all_replies == 0 then - all_replies = replies - else - combine_tables(all_replies, replies) - end + combine_tables(all_replies, replies) end table.sort(all_replies, function(a, b)