aaronpk / XRay

X-Ray returns structured data from any URL
https://xray.p3k.app
MIT License
90 stars 15 forks source link

Entry incorrectly considered feed? #99

Closed janboddez closed 4 years ago

janboddez commented 4 years ago

(Here I am again ...) I'm seeing X-Ray treat https://calumryan.com/notes/3540 as a feed, but can't figure out why. (Granted, I haven't looked into to it too well. Still, seems this shouldn't happen. There's no mention of h-feed and only a single h-entry.)

aaronpk commented 4 years ago

This is a tricky one and I'm not sure I can solve it without breaking other things.

http://pin13.net/mf2/?url=https%3A%2F%2Fcalumryan.com%2Fnotes%2F3540

There are two problems with the markup on the page

1: There's two top level objects, an h-adr and an h-entry. 2: The h-entry does not have a u-url property

If either of those were solved then it would be correctly parsed as an h-entry. (Only one top-level object would be parsed as an entry, and if one of the objects on the page has a u-url matching the url it was fetched from then only that object would be returned.)

janboddez commented 4 years ago

Interesting, thanks!

Seems like there's two options, even without "fixing" anything on X-Ray's side:

  1. "Better" markup
  2. For clients (Microsub readers, Webmention parsers, etc.) to either look into the h-feed (which does contain the h-entry I was expecting) or discard unexpected h-feeds (or anything else that isn't an entry) altogether.