For example https://meta.discourse.org/c/dev/7.json displays me a list of topics for dev categories
Can I similarly display the content (raw text) of each topic in this category ?
The discussion revolves around retrieving JSON data for each raw post from topics in a specific category. eextra asks if it’s possible to display the content of each topic in the dev category, similar to retrieving a list of topics. pfaffman suggests reverse-engineering the Discourse API.
eextra attempts to retrieve the data using https://meta.discourse.org/search.json?q=category%3Abug, but faces issues with truncated content. Falco recommends using the posts.json endpoint, such as https://meta.discourse.org/posts.json?category=support, which retrieves multiple topics, but with limitations on the number of posts displayed.
To overcome the limitation, Falco advises using pagination by adding a before parameter with the last post ID from the previous call. This allows retrieving more posts, but requires multiple calls. pfaffman also shares a potential solution using the discourse-downloader script.
For example https://meta.discourse.org/c/dev/7.json displays me a list of topics for dev categories
Can I similarly display the content (raw text) of each topic in this category ?
Thanks a lot. It helped a bit.
I don’t know if this is correct and optimal but I did something like that. https://meta.discourse.org/search.json?q=category%3Abug
How can i show all the content of the post and not the first ~300 characters?
https://meta.discourse.org/t/how-do-i-get-the-json-for-the-each-raw-from-topics-in-the-category/148340.json
But this is content from only one post and I am interested in a collection of posts
If you need multiple topics, with all posts, you need to do multiple calls.
There is also the posts.json endpoint, aka https://meta.discourse.org/posts.json?category=support.
This might help: GitHub - pfaffman/discourse-downloader: Download a Discourse topic for offline analysis · GitHub (or it might not work at all–for example, it might not properly put the API key in the header rather than the URL)
Thanks a lot - you always get to the point!
Is it possible to display everything on one page ? / (currently only 45 topics are displayed)
You need to paginate.
For the second call add a parameter name before with the value of the last post ID you got in the previous call.
Example: https://meta.discourse.org/posts.json?category=support&before=735490