Discourse איזה ממשק יכול לקבל ישירות את תגובת הפוסט האחרונה

אני צריך שיהיה לי דיון שיכול לקבל ישירות את תגובת הפוסט האחרונה, רק צריך לציין את מזהה הפוסט, לא צריך לציין את מספר הקומה, רק לקבל את תגובת הפוסט האחרונה. האם יש ממשק כזה?

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 :smiling_face:

2 לייקים

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

לייק 1

תודה רבה לכולם, כבר פתרתי את זה בדרך אחרת.

האם תרצה לשתף כיצד פתרת זאת? זה יכול לעזור לאחרים עם אותה שאלה.

לייק 1

It is done through two interface calls, one to get the total number of comments and then use that number to get the last one.

2 לייקים