Admin: What about posting to Discourse via URL?

I have seen mention of possibility to directly post (new threads) via launching an URL. That is VERY interesting to me as it would give a way I can author a FIRST post in a thread in TiddlyWiki. THEN directly post it to Discourse.

Discourse is not spectacularly documented IMO. So having seen mention of URL posting (hidden feature?) I have NOT been able to locate the relevant docs since that time.

So, SHORT QUESTIONS: (1) Can we post via URL? (2) IF so, where are the docs? (3) If answer to (1) is “+”, Shirley we do need a communal TW macro that does it so anyone could post here from their Wiki!

Best wishes
TT

Thanks for pointing out this capability - it would be extremely useful if we can get this working.

Discourse is not spectacularly documented IMO.

I don’t know if there are any docs for end users, but I’m not sure that is really needed for something like an internet forum. The basic usage is just like any other forum, and for anything beyond that you will get the quickest answer by doing a google search.

I just did a quick search and found this post which explains how to create a post from a URL: How to create a post clicking a link?

On tiddlywiki.com I created a ViewTemplate tiddler with the following:

<$list filter="[is[current]tag[Discord post]]">
<$wikify 
name=url 
text="""http://talk.tiddlywiki.org/new-topic?title={{!!title}}&body={{!!text}}""">
<a href=<<url>> target="_blank">Post to discord</a>
</$wikify>
</$list>

Then any tiddler with the tag “Discord post” will show a link which opens discord and pre-fills the title and text.

It works for single paragraphs, but seems to have problems with formatting for multiline tiddlers. Perhaps someone else could chime in with a way to properly encode all the formatting into the URL?

1 Like

That’s interesting, thanks for posting this. Maybe you can try the following:

<$list filter="[is[current]tag[Discord post]]">
<$wikify 
name=url 
text="""http://talk.tiddlywiki.org/new-topic?title={{{ [{!!title}encodeuricomponent[]] }}}&body={{{ [{!!text}encodeuricomponent[]] }}}""">
<a href=<<url>> target="_blank">Post to discord</a>
</$wikify>
</$list>
1 Like

The suggestion from BTC seems to work. I did try it at tiddlywiki.com

The only problem is, that we need to be careful with <code> elements they need to be written like this: `<code>` elements, otherwise the forum doesn’t render them. It tries to render it as html


Don’t call me Shirley

Or we need to wikify TW wikitext into markdown (without tables) instead of html and send this text to the forum.
I do like this idea. …

A somewhat more complete solution that sets also the tags and category would look like this:

<$list filter="[all[current]tag[$:/tags/Discourse]]">
<$wikify name=url text="""http://talk.tiddlywiki.org/new-topic?title={{{ [{!!title}encodeuricomponent[]] }}}&body={{{ [{!!text}encodeuricomponent[]] }}}{{{ [all[current]get[category]has[subcategory]encodeuricomponent[]] :reduce[<..currentTiddler>get[subcategory]encodeuricomponent[]addprefix[/]addprefix<currentTiddler>addprefix[&category=]] :else[all[current]get[category]encodeuricomponent[]addprefix[&category=]] }}}{{{ [all[current]tags[]] -[[$:/tags/Discourse]] +[encodeuricomponent[]] +[split[ ]join[,]] +[addprefix[&tags=]] }}}""">
<a href=<<url>> target="_blank" class="tc-tiddlylink">{{$:/language/PostToDiscourse/Hint}}</a>
</$wikify>
</$list>

Create a tiddler tagged $:/tags/ViewTemplate and place this code inside
Create the tiddler $:/language/PostToDiscourse/Hint and write something like “Post to Discourse” in its text field

Then all tiddlers tagged $:/tags/Discourse will have a “Post to Discourse” link at the bottom
All additional tags to the tag $:/tags/Discourse will show up as tags in the Discourse dialogue
The field “category” of the tiddler is used to set the category, the field “subcategory” is used to set the subcategory

1 Like

Ah, this is a killing feature!

Thank you all!

@boris this worth to be added to #how-to

What is this .. in front of currentTiddler?

Oh, I believe I’m using something that only works with the current prerelease (v5.2.0)

See here

@Mohammad — go for it!

New posts in How To are now wikis, so others can improve it after you post.

I would suggest something like “Posting to a Discourse forum using TiddlyWIki” and copying @BurningTreeC’s final solution in and linking back here for the extended discussion.

1 Like

@boris - I did create a new thread here: Posting to a Discourse forum using TiddlyWIki

@BurningTreeC have a look and revise if I did any mistake

1 Like

Great! And I had missed that @Sii had posted the original.

Since we were talking about the Solved plugin which is now installed, I’ll demo that here by marking @Sii’s answer as “the solution”.

TBH since my original answer was somewhat incomplete I would go with @BurningTreeC’s answer as the main solution.

Once a Post is generated have we a workflow to turn this into a link to the discussion?

Rather than generate a post and look at the feasibility.

I thought I would put the Question here for those who have a deeper knowledge of the URL Mechaisium.

Perhaps once you post, you harvest the Post link and add this to a discourse field and the view template displays the link if available rather than still display the new post link?

Folks @Charlie_Veniot raises on GG the idea of linking from TiddlyWiki.com to
Discourse
perhaps making use of the above tool and including consideration of my last reply.

I answered here

These two things are the inverse of each other. You can embed Discourse discussion threads but not on arbitrary sites. So, we can set up TW.com to have comments as I mentioned in the linked post.

1 Like

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