여러분 안녕하세요,
Discourse에서 게시글을 업데이트하는 봇을 설정하는 가장 좋은 방법(또는 잘 문서화된 방법/초보자 가이드)을 찾고 있습니다.
라즈베리파이를 사용하여 스위치를 확인하고, 그 상태에 따라 우리 포럼의 게시글을 업데이트하려고 합니다.
좋은 조언이 있다면 알려주세요. 미리 감사합니다.
Richarde
Pravi
(PK)
6월 26, 2021, 6:44오후
2
게시물을 원격으로 업데이트하려면 이메일 수신기를 구성하거나 Discourse API에 의존해야 합니다.
@Pravi 감사합니다
초보자를 위한 가이드가 있을까요?
미리 감사드립니다
수정: API가 제공하는 가능성을 생각해보니, 그 솔루션을 더 선호하게 되었습니다.
지금 바로 설정에 대한 정보를 찾아볼게요… 팁이 있다면 환영합니다.
fzngagan
(Faizaan Gagan)
6월 27, 2021, 12:33오후
4
이 지엠을 사용하여 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…
Pravi
(PK)
6월 27, 2021, 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 …
진행 중입니다:
지금까지 한 일:
API 키 생성
Postman에서 몇 개의 Put 요청과 Get 요청을 작성했고, 완벽하게 작동했습니다
컬렉션을 JSON 파일로 내보내기
해당 API를 위한 Ruby 프레임워크가 있다는 것은 알고 있지만, 이미 파이썬으로 몇 가지 스크립트를 작성해 본 경험이 있어 파이썬을 선호합니다.
어떻게 진행해야 할지 아이디어가 있는 분 계신가요?
감사합니다
Richarde
음, 방금 pydiscourse를 찾았는데 꽤 잘 작동하는 것 같습니다
그래서 Postman에서 모든 것을 설정하는 단계는 필요하지 않았지만, API의 논리를 이해하는 데 도움이 되었으니 완전히 허비한 시간은 아니었습니다
간단히 말해서, Python을 통해 Discourse와 상호작용하려면 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