I want to fetch all the topics since a given time. I read discourse API Docs, but didn’t find anyone can be useful.
Is there anyway to do this?
I want to fetch all the topics since a given time. I read discourse API Docs, but didn’t find anyone can be useful.
Is there anyway to do this?
The Data Explorer Plugin would enable you to do this.
You might back up and say what problem you’re trying to solve. You can see what the advanced search page will do. You’ll need to call it multiple times if there AERA lots of topics.
The whole problem is as follow : For each half an hour, check all the topics, for a certain topic, if the create time or the latest post time > 30 mins, and the latest post was by the creator of the topic, send the url of those topic to a third part application.(wechat)
I think first I need to fetch all topics, and then filter those by conditions.
I am totally new to discourse, even to web things, it’s even the first time for me to use a rest api.
Is there any other sounds solution?I hope you guys can give me a solution.
Thanks in advance.
I think the way to solve that problem is with a web hook or a plugin that tests every new topic and posts it if appropriate.
You might take a look at the chat integration plugin, either as a solution or a model for one.
You can fetch the latest posts by getting /latest.json
. If the oldest post there is still newer than your “since” time, fetch /latest.json?page=1
and then page 2 and so on.