Chrome/Firefox extension "Share to discourse"

I’m not interested in making a browser extension, but I’d like to try making a share to Discourse plugin for WordPress. A specific logo could be used to link to a specific forum, or clicking a general logo could open a modal window with a list of forums that had registered with the plugin. Once a forum was selected, it would be possible to offer a list of categories/groups/individuals to share the post with.

The end result would be to open a new browser tab with a link similar to the one @david posted. Doing it this way would let Discourse handle the most of the work.

I’ll try making a prototype of it and see if it makes any sense. Thanks for the idea.

4 Likes

I’m willing to support that idea Simon but I’m sure there is a audience for that.

Elsewhere on meta.discourse, I’ve posted my interest in a high-level, onebox integration of Diaspora* a privacy-aware, distributed, open source social network that can bring synergistic enhancement to Discourse such as a more feature rich User Profile but without adding complexity and dreaded Feature Fatigue.

Adding standard, and it is unquestionably a web standard, contempory social media share tools caters to web denizens whose lives online are entirely on the surface:

  • Instagram,
  • Snapchat,
  • YouTube,
  • Facebook
  • Oxford English Dictionary

The SUBVS.US proposal for the Diaspora of Discourse plugin with Diasora sidebars open and Discourse selected instead of the stock Diaspora Activity Stream


Instead of static sidebars these have Sliders ie Baby Hamburgers on each side that can be set to open and close automagically or manually. In this mockup we see the Discourse forum is “In Focus”, the Activity Stream is always a toggle away from use.

A social media button would be accessible at all times within the editor.

The iconic share buttons look and work the same on every website. All of them are connected, and I simply propose making acess to that ecosystem possible from within a Discourse paradigm.

Another long term project you probably will claim you don’t get, is Discourse for Google Docs, a version of WordPress for Google Docs it is one of my all time favorite chunks of code from Automatic.

1 Like

This will be covered by the new Web API:

https://github.com/WICG/web-share-target/blob/master/docs/explainer.md

7 Likes

This is live in Chrome Canary/Dev. However Firefox and Chrome devs are discussing the string format of the URL and this will not land in stable browsers until it gets settled.

Here is how it will work when this lands:

7 Likes

This is what I have been looking for! A lot of people like to just click and share, I have a few web site owns will to place something like this on there website so our users can post on to our forums with ease

2 Likes

This has helped me tremendously.

This opens it in a new window and adds a category of links:

javascript:window.open("https://www.example-forum.com/new-topic?category=links&title="+encodeURIComponent(window.location.href), "_blank");

Now I can very quickly add links to the my forum that I can later sort through. Considering I’m using the forum like a knowledge base or digital garden, this can make it super easy to dump links in there to later refine.

3 Likes

BTW, in case anyone is wondering what to do with that, save it as a bookmark then you can click the bookmark to take the action

1 Like

this is a challenging subject… how can i get useful links onto discourse at the press of a button.

I suppose the logic can’t be far different from a “Post to Discourse” button in iOS Share sheet.

This could be programmed as follows;

  • Receive input from Share Sheet, the button on Share Sheet will be name of the Shortcut
  • Get text from Shortcut input
  • Text ook (part of the word Look as in “Look what i found on”)
  • Text I (as in “I found”)
  • Text Source: (as in saying where the URL is from)
  • Text heck (part of the word Check as in “Check out what i found”)
  • If any of above text is the input text
  • Replace Source: with just want a link
  • Get URLs from that
  • Get host
  • Get path
  • Get query
  • Encode host, path, ?, them query, as URL
  • Text https://yourdomain.co.uk/new-topic?title=Shared%20from%20iOS&body=https://[encoded URL]
  • Open that Text in Safari

Otherwise

  • If the shortcut input text contains g.co
  • Match https?://(.*) in Text
  • Get group at index 1 in matches
  • Text https://yourdomain.co.uk/new-topic?title=Shared%20from%20iOS&body=https://[the text]
  • Open that Text in Safari

Otherwise

  • If shortcut input text contains youtube
  • get host
  • get path
  • get query
  • encode
  • text of the forum url
  • open in safari

Otherwise

  • text is just text
  • just let the body be the text

:rofl: