我需要有个discourse能直接获取某个帖子的最后一条评论信息只需要指定帖子id楼层不需要指定直接获取最后一条评论信息。有这个接口吗?
I would recommend using a data explorer query for that. You can programmatically run queries and get JSON results. Here you go:
-- [params]
-- post_id :post_id
SELECT
p.id,
p.topic_id,
p.post_number,
p.raw AS raw_content, -- Markdown/source
p.cooked AS html_content, -- Rendered HTML
p.user_id,
p.created_at,
p.updated_at
FROM posts p
WHERE p.id = :post_id
AND p.deleted_at IS NULL -- drop if you want deleted posts too
-- AND p.hidden = false -- optionally exclude hidden posts
LIMIT 1;
إعجاب واحد (1)
是两个不同的服务,只能对接接口的方式获取
Maybe you could explain a little bit more what you’re trying to achieve? Then I could make you a Python script for example ![]()
إعجابَين (2)
You can create the data explorer query, then call it using the API.
إعجاب واحد (1)
感谢各位大佬,我已经通过其他方式解决了。
Do you mind sharing how you solved it? It could help others with the same question.
إعجاب واحد (1)