snarfed / bridgy

📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
703 stars 52 forks source link

Original post discovery: support for rel=alternate type=application/mf2+json #1569

Open cybeardjm opened 9 months ago

cybeardjm commented 9 months ago

Hi,

Been playing with the various IndieWeb and syndication features for WordPress today.

As it seems the old “Microformats2” plugin is not maintained anymore (doesn’t seem to work nice with the Twenty Twenty-Three theme anyway), I’m testing the MF2 Feeds plugin instead.

From the description: "Provides a Microformats2 JSON “Feed” for every WordPress URL, and helps to allow other sites to get pre-parsed Microformats-JSON even if the theme does not support Microformats2."

It generates these alternate links for posts:

<link rel="alternate" type="application/mf2+json" href="https://domain/sample-post/feed/mf2/" /> <link rel="alternate" type="application/jf2+json" href="https://domain/sample-post/feed/jf2/" />

But, they're not supported for discovery (so far, it seems) as alternate means to check for microformats in a post. => when I test a preview to publish on Mastodon, I get errors such as "Mastodon doesn't support type(s) h-cite, or no content was found." or "No h-entry found" (on a https://indiewebify.me/validate-h-entry/ test)

snarfed commented 9 months ago

Hmm, good idea! Right now we only support separate feeds with rel=feed, and only HTML: https://brid.gy/about#link . For other types like this, we probably wouldn't look for these URL paths specifically, and I doubt we'd add JF2 support, but we could maybe ingest MF2 via rel=alternate type=application/mf2+json.

Not a priority for me personally right now, but this would be a pretty reasonable first project if you want to contribute. Dev docs at https://bridgy.readthedocs.io/ , code for this would go somewhere around:

https://github.com/snarfed/bridgy/blob/6d5b0cbafa19ef00f8c8086116b2e1d49b030d52/original_post_discovery.py#L322-L348

cybeardjm commented 9 months ago

Thx @snarfed - unfortunately, am no dev, just an "advanced user", so wouldn't even try to mess with the code... Ok, will wait till it works some day, will stick with ActivityPub 100% in the mean time...

snarfed commented 9 months ago

Np, we can keep it open!

dshanske commented 9 months ago

I have another option we use in our Webmention plugin using the WordPress rest api... but someone would still need to implement.

cybeardjm commented 9 months ago

OK, been playing with various plugins all day long, including Webmention, from various Fediverse apps... Thx