Best Practise for Using a Raspberry PI as Bot for Posting Updates in Discourse

Hi Folks,

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.

Richarde

Inorder to update a post remotely you have to either configure an email receiver or you may depend on discourse API.

1 Like

Thx @Pravi
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.

4 Likes

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.

https://meta.discourse.org/search?q=discourse%20api

https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063/2

3 Likes

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?

best regards
Richarde

1 Like

Ok, I just found pydiscourse and that seems to work pretty good :slight_smile:

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 :slight_smile:

in short - if you want to interact with your discourse via python you can use pydiscourse by

(Based on original authors list and may be incomplete)

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 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.