Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish: support XML posts #1766

Open
dannypsnl opened this issue Jul 30, 2024 · 3 comments
Open

Publish: support XML posts #1766

dannypsnl opened this issue Jul 30, 2024 · 3 comments
Labels

Comments

@dannypsnl
Copy link

dannypsnl commented Jul 30, 2024

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
Copy link
Author

dannypsnl commented Jul 30, 2024

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 snarfed changed the title It seems I cannot publish a path to xml Publish: support XML posts Jul 30, 2024
@snarfed
Copy link
Owner

snarfed commented Jul 30, 2024

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
Copy link
Owner

snarfed commented Jul 30, 2024

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

bridgy/util.py

Lines 326 to 328 in 2febacb

html = (resolved.headers.get('content-type', '').split(';')[0]
in ('text/html', 'text/mf2+html'))
send = html and resolved.status_code != util.HTTP_RESPONSE_TOO_BIG_STATUS_CODE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants