Quale interfaccia Discourse può ottenere direttamente le informazioni sull'ultimo commento di un post?

我需要有个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 Mi Piace

是两个不同的服务,只能对接接口的方式获取

Maybe you could explain a little bit more what you’re trying to achieve? Then I could make you a Python script for example :smiling_face:

2 Mi Piace

You can create the data explorer query, then call it using the API.

1 Mi Piace