indieweb / mention-client-php

Client library for sending webmention and pingback notifications
https://indieweb.org/webmention
97 stars 19 forks source link

Find links in canonical mf2 object #29

Open aaronpk opened 8 years ago

aaronpk commented 8 years ago

Currently the findOutgoingLinks function naively looks only at the first mf2 object in items.

Here is the proposed solution:

Add a parameter to findOutgoingLinks that accepts the source URL of the page. For each item in the mf2 items, look for the item with a url property that matches the URL given. If none is found, defaulting to the first item is fine.

This works under the assumption that this function will only be used for sending webmentions for post permalinks, as this will not work for feed pages that contain multiple h-entrys (although it will work for a feed page that uses h-feed).