mr8
2017 年 8 月 29 日午後 10:50
1
Hello,
I’m trying to get the number of likes for a single post via the API, but can’t seem to find it…
I see a like_count for the entire topic, but can’t seem to find the individual like count for each post in either /t/123.json or /posts/222.json.
I noticed that I can get a list of users who liked a post via /post_action_users.json and add them up manually, but what is the recommended way to to get the “like count” for an individual post?
Thanks!
「いいね!」 2
mr8
2017 年 8 月 29 日午後 10:56
2
I’m an idiot!
Found it under "actions_summary":
{"id":2,"count":5,"acted":true}
Well, hope this helps someone else!
「いいね!」 16
NathanLei
(NathanLei)
2019 年 12 月 2 日午前 9:51
3
mr8:
actions_summary
Love you man! that helps me a lot!
残念ながら、Discourse は投稿に「いいね!」がない場合、そのプロパティを削除します。
また、API ドキュメントにも記載されていません: Discourse API Docs , Discourse API Docs
そのため、信頼性が低く、コードが不要な「if property object exist」によって汚染されます。
改善されるべきです。
「いいね!」 1
blake
(Blake Erickson)
2023 年 3 月 14 日午後 2:26
6
Beda:
APIドキュメントにも記載されていません
フィードバックありがとうございます。APIドキュメントを見ると、いいねの作成方法については記載がありますが、取得方法については情報がありません。まずはその部分のAPIドキュメントを改善することから始めます。
「いいね!」 1
それについては本当に感謝しています。
これが(人間が書いたものですか?!)お手伝いできることがあればお知らせください。
しかし、Discourseが書かれているRuby、あるいはそれに類するものにPHPdocのようなものを使用しているのではないかと推測しています。
その言語の経験がないため、プログラム的なものであれば(まだ)お手伝いできません
「いいね!」 1
blake
(Blake Erickson)
2023 年 3 月 20 日午後 2:27
11
Beda:
人間が書いたものですか?!
50/50だと思います。手作業もまだありますが、rspecテストからrswagというツールを使って生成されています。
This is a guide for contributing to the official Discourse API documentation.
Required user level: Developer
Console access required
Do you want to contribute to the official API documentation at https://docs.discourse.org ? This guide will explain step by step how to do it.
Summary
This documentation will guide you through the following steps:
Setting up prerequisites.
Cloning the Discourse API documentation repository.
Editing the API documentati…
「いいね!」 1
system
(system)
クローズされました:
2023 年 4 月 19 日午後 2:28
12
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.