Is it possible to write a custom client other than a web browser?
Samuel_Crow wants to create a micro-sized, lightweight forum browser style client for directly interfacing with the REST of a server-side forum. However, this client requires the format to be XHTML, custom XML, or JSON instead of ordinary HTML.
Mittineague suggests that most Discourse pages can be output as RSS or JSON. Samuel_Crow finds the JSON output more useful but is concerned about the “cooked” field, which contains HTML5.
Falco confirms that “cooked” will be HTML5 and not XHTML. Falco also notes that Discourse requires PostgreSQL, which Samuel_Crow does not currently have.
Samuel_Crow asks if there are plans to export posts as XHTML in the future, but Falco says it’s unlikely. Instead, Falco suggests using the raw post, which is in Markdown format.
Samuel_Crow asks about the format of the raw post and Falco replies that it’s Markdown. pfaffman suggests that Samuel_Crow can make multiple requests to pull out all messages.
Samuel_Crow considers implementing CommonMark in C as a plugin to the GUI. After looking at the CommonMark spec, Samuel_Crow thinks it may be possible to patch the reference code to generate XHTML 5 instead.
I would like to make a micro-sized lightweight forum-browser style client for directly interfacing with the ReST of a server-side forum.
Among the requirements are that the format not be ordinary HTML but XHTML, custom XML or JSON instead. In this way, I can use a simple library to parse the markup from the forum. Another less stringent requirement is that images be able to open on a full-screen display with only a shallow color-depth thumbnail to indicate its contents. CSS won’t be needed either because I will be replacing the customization with native GUI elements.
Will this require a plug-in? Is the Ruby on Rails portion of Discourse up to the task? Will I run into hard-coded limits?
One final note: I don’t have a Postgres SQL host right now so if I can’t do it I need to know so I can look at other ReST interfacing forum software that will work with my current host.
I’m not clear about exactly what you have in mind to do, but most Discourse pages can be output as RSS (maybe not exactly what you had in mind as XML, but it is a subset) or JSON.
For example https://meta.discourse.org/t/is-it-possible-to-write-a-custom-client-other-than-a-web-browser/51671.rss https://meta.discourse.org/t/is-it-possible-to-write-a-custom-client-other-than-a-web-browser/51671.json
SInce the RSS didn’t view the whole post by default in the RSS Feed Reader I tried, I’d still have to use a Web Browser to view the whole post. The JSON file looked more useful though. Is there documentation on the “cooked” field of each post? It appears to be HTML or XHTML but if it is a limited subset, that would be ideal!
Adding different hosting is not a deal breaker but having to implement HTML5 completely just for a forum browser would be. Are there any plans to export the posts as XHTML in the future?
XHTML 5 is very similar to HTML 5 and shouldn’t take much effort but I have another idea. If the cooked HTML5 uses only a subset of the HTML 5 tags I could formulate a mini-browser just for that subset. The only thing that scares me about HTML 5 is that it tries to be semantically rich with tag names like “sidebar” and “caption”. If it can be guaranteed that the posts returned by the server never use some of the uncommon tag names, I’d be happy with that for now.
No, you’d just need to do multiple requests to pull out all of the messages. As a rule, you get 20 posts at a time. Here is a Ruby program I wrote to download a topic (or all topics in a category) as text or HTML files.