indieweb / indieweb/mention-client-php
Find links in canonical mf2 object
- Dominant language
- HTML
- Stars
- 105
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Currently the `findOutgoingLinks` function naively [looks only at the first](https://github.com/indieweb/mention-client-php/blob/54aa38347313df7a4400d9f6afa0a78f425d84ee/src/IndieWeb/MentionClient.php#L248) 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).
Contributor guide
Research direction
Start in src/IndieWeb/MentionClient.php at findOutgoingLinks, then inspect its callers to see how the source URL can be passed. Verify that the canonical mf2 item is selected by matching its url and that the first item remains the fallback when no match exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100