Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Send Webmentions #535
This PR implements the feature discussed here.
The general idea was to be as little invasive a possible.
I made some changes to the initial plan.
I ended up not storing the webmentions endpoint in the database: we won't have the webmention endpoint synchronously as we need to download and parse the link page. We also can't put this webmention discovery in the fetchAttributes function as I first intended to do: there's no way to retrieve the content downloaded by this function when saving the story.
So instead, everything is done in a cron-triggered task. I think this is a better design, everything stays compartmentalized.
I also added some markup necessary to make the repost parseable by the webmention endpoint.
The markup has been tested against the official validator. The parser has been manually tested against the webmentions.rocks examples. The post method has been manually tested.
I tried to markup the comments but did not find an immediate way to do so. The current template structure makes this tricky.
I plan to maintain the changes introduced by this PR.
We'll also need to add this cron task to the ansible playbook. Should I open another PR there?
[Edit] Looks like the linter is angry. I'm fixing it.
This really isn't very much code, that's great. I like how well you've contained it, especially the way you've broken out the parsing utility functions from the main logic. I've got some small tweaks, but this is overall solid and I look forward to merging it soon.
Alright, it should be good now.
Could you please review the sponge calls change, this is the only "dangerous" part of this PR, I really don't want to screw this up.
Other than that, Travis still fails on the "next unless" pattern. I guess we don't really care.
Sorry for the delay :)