此端点承诺返回信息包括指定的帖子,例如:
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq .post_stream.posts[].post_number
33
34
35
36
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
作为单页应用程序,Discourse 高效地使用其 API 来最大限度地减少工作量。每次 API 调用一个帖子是不合理的;这会大大增加客户端和服务器之间的通信量。
从结果中选择您期望的帖子非常简单。与上面相同,仅获取帖子 40 的已处理内容:
○ → curl -s 'https://meta.discourse.org/t/fkb-pro-social-theme/234323.json?post_number=40' | jq -r '.post_stream.posts[] | select(.post_number == 40) | .cooked'
<p>Hi Tiago,</p>
<p>Can you please clarify it a little bit? Some screenshots, your actual code and where is your advert appear would be very helpful. Thank you <img src="https://emoji.discourse-cdn.com/twitter/slightly_smiling_face.png?v=12" title=":slightly_smiling_face:" class="emoji" alt=":slightly_smiling_face:" loading="lazy" width="20" height="20">
</p>
或者,如果您绝对想返回有关您正在查询的单个帖子的信息,您可以随时创建一个仅执行此操作的数据探索器查询。