Open sebsel opened 7 years ago
Here's how I solved the problem outside of php-comments: https://github.com/sebsel/seblog-kirby-webmentions/blob/master/lib/endpoint.php#L85 This solves step 6.
I then wrote a messy hcard()
function to grab a h-card for that url, and store it in a separate cache.
https://github.com/sebsel/seblog-kirby-webmentions/blob/master/lib/author.php#L59
But that solution is not ideal and depends on your website setup.
Yeah, the trick is that people who are using this library don't want to be tied to whatever HTTP library happens to be used by this library, and I can't guarantee curl functions are available either. This would have to be solved by providing a hook where the library requests an HTTP request be made, and whoever is using the library would go make the HTTP request and return the result.
Since this repo is still used by a lot of sites, better to actually file issues :)
It seems like php-comments does not follow the algorithm for discovering authorship as described on https://indieweb.org/authorship Some chat around it: https://chat.indieweb.org/dev/2017-01-02#t1483370937764000
Few challenges with this:
parse()
takes ah-
object. You pass in the$mf2['items']
part that comes out of a Mf2 parser, not the whole thing. This means you have no access to the$mf2['rels']
part of the page, whererel="author"
-links reside.When the author is only a URL, (step 7) we need to grab another page. Currently, there is no curling nor mf2 parsing done inside of php-comments, so that's impossible.
@aaronpk's XRay does a better job at these things.