aaronpk / XRay

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

When discovering a h-feed with only one h-entry, parse it as h-entry #28

Closed sebsel closed 7 years ago

sebsel commented 7 years ago

When discovering a h-feed with only one h-entry, parse it as h-entry.

This has to wait for #1, but can be useful when people put a h-feed around their h-entry.

Example: https://sijmen.ruwhof.net/weblog/1166-how-to-hack-the-upcoming-dutch-elections And previously posts on https://licit.li, although Martijn has fixed it now.

aaronpk commented 7 years ago

hmm, it looks like you're talking about the case when people forget their whole site is wrapped in h-feed and include that in post permalinks too? That seems like incorrect markup and I'm hesitant to try to "fix" it for them.

There are counterexamples where an h-feed might legitimately have only one entry but still be a feed, such as tag pages.

The one way I could see doing this would be if the url property of the h-entry inside the h-feed matched the URL of the page that was fetched, so that at least that way I could be reasonably sure the intent was that the page is a permalink.

sebsel commented 7 years ago

Fair point. This would not solve the above example, because he does not have a u-url on his h-entry. In the end it just comes down to bad markup (forgotten Mf1) at the other end of the url.

I close this one then.