こんにちは、皆さん!
Discourse の投稿をボットで更新する最適な方法(またはよくドキュメント化された方法/初心者向けガイド)を探しています。
私たちはラズパイを使っていくつかのスイッチの状態を確認し、その状態に応じてフォーラムの投稿を更新したいと考えています。
良いアドバイスがあれば歓迎します。事前にありがとうございます。
Richarde
Pravi
(PK)
2021 年 6 月 26 日午後 6:44
2
投稿をリモートで更新するには、メール受信者を設定するか、Discourse API に依存する必要があります。
「いいね!」 1
@Pravi さん、ありがとうございます。
これに関する初心者向けのガイドはありますか?
あらかじめお礼申し上げます。
追記:API がもたらす可能性について考えているうちに、そのソリューションの方が良いと思い直しました。
今から設定方法について調べるつもりです…ヒントがあればぜひ教えてください。
fzngagan
(Faizaan Gagan)
2021 年 6 月 27 日午後 12:33
4
この gem を使用して Discourse に接続し、必要なあらゆる操作を実行できます。
So you want to use Discourse API ? Great! Let’s get started.
Set up Discourse development environment
Set up Discourse development environment using our Windows , macOS or Ubuntu guide.
Clone Discourse API Gem
Now that you have set up Discourse development environment, you should already have Git and Ruby installed on your system. You can install Discourse API gem by running following command from console:
git clone https://github.com/discourse/discourse_api.git ~/discourse_api
Alternatively…
「いいね!」 4
Pravi
(PK)
2021 年 6 月 27 日午後 12:35
5
Discourse API を使ったことがないため、API に関するお手伝いはできません。しかし、以下のリンクがスタートするのに役立つことを願っています。
https://meta.discourse.org/search?q=discourse%20api
Discourse API
Please view the Discourse API Documentation site for detailed info:
https://docs.discourse.org
Authentication
API requests must use HTTP header based authentication. Pass your Api-Key and Api-Username as HTTP headers. Authentication via query parameters or request body is not supported (this was removed in April 2020). Please see the example cURL request below.
The only API endpoints that continue to support credentials in query parameters are requests to…
https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063/2
Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api.
The API is documented at docs.discourse.org . You can also use the discourse_api Ruby gem as a client library. However, not every endpoint is documented.
To determine how to do something with the JSON API here are some steps you can follow.
Example: recategorize a topic.
Go to a topic and start editing a category:
[image]
Open Chrome dev tools, switch to the Network tab, select …
「いいね!」 3
現在、進行中です:
これまでに実施したこと:
API キーの生成
Postman でいくつかの PUT リクエストと GET リクエストを作成し、問題なく動作確認完了
コレクションを JSON ファイルとしてエクスポート
API 用の Ruby フレームワークがあることは承知していますが、すでに Python でスクリプトを作成した経験があるため、Python を使用したいと考えています。
次にどのように進めればよいか、ご存知の方がいらっしゃいましたらご教示ください。
よろしくお願いいたします。
リチャード
「いいね!」 1
OK、pydiscourse を見つけました。これならかなりうまく機能するようです
つまり、Postman でセットアップするステップは必須ではありませんでしたが、API のロジックを理解する助けになりました。時間を無駄にしたわけではありません
要約すると、Discourse を Python で操作したい場合は、以下の pydiscourse を使用できます。
(元の作者のリストに基づいていますが、不完全な場合があります)
Marc Sibson
James Potter
Ben Lopatin
Daniel Zohar
Matheus Fernandes
Scott Nixon
Jason Dorweiler
Pierre-Alain Dupont
Karl Goetz
Alex Kerney
Gustav https://github.com/dkgv
「いいね!」 2
system
(system)
クローズされました:
2021 年 7 月 27 日午後 5:30
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.