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
710 stars 52 forks source link

Publish: support XML posts #1766

Open dannypsnl opened 1 month ago

dannypsnl commented 1 month ago

I'm trying to publish https://dannypsnl.me/webmention-0001.xml, but get

Unsupported source URL https://dannypsnl.me/webmention-0001.xml

on the website:

image

so I wondering how to solve it.

dannypsnl commented 1 month ago

NOTE: I also test to ensure that, a html will work

<html>
  <head>
    <link rel="webmention" href="https://webmention.io/dannypsnl.me/webmention" />
  </head>
  <body>
    <div class="h-entry"><p class="e-content">
      Two naked tags walk into a bar. The bartender exclaims, "Hey, you can't come in here without microformats, this is a classy joint!"
    </p></div>
  </body>
</html>
image
snarfed commented 1 month ago

Interesting request! Bridgy Publish doesn't officially support XML posts right now, but it's a fun idea.

The key first step would be determining the current state of XML support in microformats2 parsers, since Bridgy Publish uses an mf2 parser to extract the relevant data to publish. Looks like both php-mf2 and mf2py do extract at least something from your post, which is a good start! Not a lot though.

snarfed commented 1 month ago

For my own notes, for if/when we add XML support, it'd start here:

https://github.com/snarfed/bridgy/blob/2febacb3e3e396990569f14511f733b7f236f7a2/util.py#L326-L328