netlify-plugin-webmentions
netlify-plugin-webmentions copied to clipboard
Check pre-build feed to determine how many posts to update
I would like to be able to have the plugin dynamically determine the limit value based on how many feed values have updated values later than the pre-build feed updated time.
Code flow
- Before the build, fetch the feed.xml file and read the
feed.updatedvalue - After the build, look at the updated feed.xml file and check how many items in the feed have an updated value after the pre-build feed updated value
- Call
@remy/webmentionwith the updated count as thelimitvalue
Considerations
Ideally, the upstream dependency would accepted the since value, but that would require work on both sides. The above flow could be opt-in with a input value such as limit: auto as it would require a more complex feed.xml file with valid updated values.
There are a number of other considerations to make too.
What happens if the site or feed is unreachable in the pre-build? Does it fail the build completely?
Also, this would add more complexity to the plugin, as it'd need to now include a RSS parser and account for various versions of RSS
Yeah, it would certainly add a significant amount of complexity and there are some questions to consider. If you're open to the additional complexity I'd be interested in working on a PR.
Regarding the pre-build fetch, I don't think that should fail the build (a new site build shouldn't fail). But I would definitely want that issue logged.
Looking at the @remy/webmention package more, I realized it accepts several different kinds of feeds so that complexity is fairly high so this might require more tight integration with that package.
I think it depends, it can either be tighter integration with the webmention package, or we use the same libraries/approach.
I'd be happy to accept a pull request on this, and I'm more than happy to help figure out the approach.
On Fri, 24 Feb 2023, 01:39 Anthony Ciccarello, @.***> wrote:
Looking at the @remy/webmention package more, I realized it accepts several different kinds of feeds so that complexity is fairly high so this might require more tight integration with that package.
— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/netlify-plugin-webmentions/issues/4#issuecomment-1442674204, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVEGQWRF365JZLINGJ3WZAGOPANCNFSM6AAAAAAU3D37EM . You are receiving this because you commented.Message ID: @.***>