I´m looking for the best way (or a good documented way / beginner guide) to set up a Bot Updating a Post in Discourse.
We want to use a Raspi to Check some Switches and depending on there state we want to update a Post in our Forum.
Any good advice welcome. Thx in Advance.
Inorder to update a post remotely you have to either configure an email receiver or you may depend on discourse API.
Is there any beginners guides to this?
Thanks in Advance
Edit: while thinking about the possibilities the API brings, I would prefer that solution.
Will start to dig now for informations about setting that up… any hints welcome.
You can use this gem to connect to your discourse and perform any operations you need.
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, OS X 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
I have never used the discourse API before. So I am unable to help you with API. But I hope the following links will help you get started.
Please view the Discourse API Documentation site for detailed info:
On April 6th, 2020 we dropped support for all non-HTTP header based authentication (excluding some rss, mail-receiver, and ics routes). This means that API requests that have an api_key and api_username in the query params or in the HTTP body of the request will soon stop working. Please see the example cURL request below for how to update your API requ…
@simonstarr for putting that how to together! It’s very clear, and I appreciate that you included a custom parameter in your example. In the response of a test query, I see "default_limit": 1000. One thing that I’m still not sure of is how to handle large sets with the api.
So I have two questions:
Can I easily increase the default cap for result sets with >1000 rows?
In a really large set (eg. > 1000000 rows) can you suggest a pattern for iterating through the subsets? My first take…
Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api.
Many of the endpoints are properly documented in the
discourse_api gem, however some endpoints lack documentation.
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:
Open Chrome dev tools, switch to the Network tab, select XHR filter:
Perform the o…
I´m on the way:
what I´ve done so far:
generating a Api Key
writing a few Put and a Get request in Postman which worked perfectly
exported the collection as json file
I know there is a ruby framework for the API but i would prefer python as a did some scripts there already.
Anyone has an idea how to proceed?
Ok, I just found pydiscourse and that seems to work pretty good
So the Step setting everything up in Postman wasn´t necessary but helped to understand the logic of the api - so it wasn´t a complete waste of time
in short - if you want to interact with your discourse via python you can use
(Based on original authors list and may be incomplete)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.