include opening post in comments

This commit is contained in:
scuti 2024-11-27 16:39:38 -08:00
parent 4d9bb430d2
commit 05ea67e03d

View File

@ -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)