In a Dev category thread titled ‘Multiple topics in single API request’, Andrew_Byrne seeks a way to fetch multiple topics via a single API call to avoid performance issues when aggregating feeds. Falco suggests querying the Discourse database directly, referencing the latest.json endpoint, while mr8 asks for guidance on secure local DB access. Falco explains exposing PostgreSQL port with firewall rules, though notes a plugin or core PR might be simpler. Andrew_Byrne prefers the ‘Discourse way’ via plugins over direct DB access. He later clarifies his use case involves microblogging topics for user feeds, requiring efficient batching [6]. He builds a basic plugin, documenting the structure [7] and sharing the repo: discourse-json-follow-list [8], which mr8 praises. Two years later, adopilot asks if the plugin still works and if it supports multiple topic IDs without user IDs. Andrew_Byrne replies it may work but isn’t production-ready, and suggests forking and modifying it — noting it runs slow DB queries that could be optimized to work without user IDs.
Using the Discourse API is pretty cool and I’ve used it to provide a number of custom interrogations in related sites. One thing that has caused me some issues is the fact I need to make single requests on each topic via:
GET discourse.foo/t/topicID/1234.json
for most Discourse systems this is cool but I am blending results, ie requesting multiple topics and adding them to a single post feed. when the number increases the requests become… annoying.
I’m looking for a solution something along the lines of the user_actions that accepts a filter. like:
GET discourse.foo/t/topicID/topic.json?filter=1234,5678,90123
interesting.. we use the API on our site (which has its limitations sometimes).
Any suggestions on how to get started with accessing the discourse database locally on the server? (don’t want to accidentally open up the database to remote connections!)
So I’m new to the whole plugin thing, but I assuming (without looking) that using a plugin we might be able to craft what we want via the application, and use it security. Rather than bypassing whats built.
I have a pretty non standard install also and accessing the DB directly would be easy. I guess I just want to try it the “Discourse way” first
So I have users that “microBlog” in to topics.
Other users can then follow peeps.
The feed needs to collect all the topics (user blogs) and sort them to in a time line. This is already working, but as you can imagine gets pretty cumbersome in terms of network requests.