Question: Auto-mentioning when a shared topic url is posted to another Discourse

I’m wondering if there is a way, possibly in modifying the shared topic url, for a link to be auto-mentioned by my system account when mentioned on this meta forum or elsewhere.

Currently, we simulate this behavior by creating a post and switching ownership to system. See it in action here.

I am not following. Can you provide a specific, real world example of why this would be desirable?

1 Like

Sure,

  1. I create a new post on Forum A
  2. I share that post via url to Forum B, which is another Discourse instance.
  3. Somehow Forum A can identify that this occurred and triggers system to automatically respond in the original Forum A thread, displaying:
    Screenshot_20200404_154041

Right, that helps, but why? What is the importance of this, why is it necessary?

(I guess we do something similar for github integration where we link Discourse topics to the commit, but that’s smushing together two great and different tastes, like chocolate and peanut butter. Here you’re smushing together peanut butter… and … err … more peanut butter?)

3 Likes

I just find this is really helpful since we are using places like meta.discourse to address issues discussed on our own Discourse, and most admins will not think to link back these threads for context to users and future maintainers. I’ve only recently taken over maintenance of our forum, so I’m hoping to leave more info for maintainers in the future. :slight_smile:

“Federation” of forum tech seems a hot topic these days. Sounds like it isn’t possible, but I thought I’d check.

It is insanely complicated. It is the “fully autonomous self driving cars are right around the corner” of social software.

The GitHub ⇿ Discourse use case is defensible, peer to peer much less so IMO, by the transitive law of Reese’s Peanut Butter Cups.

3 Likes

Isn’t that also how pingbacks worked?

They became the bane of the blogosphere, with tons of abuse and were never truly solved.

You could maybe whitelist trusted sites, but it still sounds like much headache for little payoff. What happens when one server updates to a newer version/standard?

On the other hand, wouldn’t this be relatively easy to do using incoming_links, incoming_referers and incoming_domains ?

What if one would be able to whitelist an incoming_domain and we could get oneboxes for links from those domains to that topic ?

Edit: the snippet below will list all links on Discourse sites* that point to a specific topic. Should be pretty easy to put this in a scheduled job that inserts a post in the topic whenever it finds a new link. Oneboxing will take care of the rest.

topic = Topic.find(xxx)
IncomingLink.where("post_id in (#{topic.posts.pluck(:id).join(',')})").where("incoming_referer_id is not null").each do |link|
  next unless link.incoming_referer.path.start_with?('/t/')
  puts "https://#{link.incoming_referer.incoming_domain.name}#{link.incoming_referer.path}"
end

*) I’m using a simple check now to determine if it’s a Discourse link but this could even request the home page of the site and inspect the meta data - although I think this could work very well for links from non-Discourse sites as well. Maybe whitelist the domains in plugin settings.

4 Likes