netlify-plugin-webmentions icon indicating copy to clipboard operation
netlify-plugin-webmentions copied to clipboard

Check pre-build feed to determine how many posts to update

Open aciccarello opened this issue 2 years ago • 4 comments
trafficstars

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.updated value
  • 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/webmention with the updated count as the limit value

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.

aciccarello avatar Feb 14 '23 05:02 aciccarello

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

CodeFoodPixels avatar Feb 16 '23 18:02 CodeFoodPixels

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.

aciccarello avatar Feb 17 '23 03:02 aciccarello

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.

aciccarello avatar Feb 24 '23 01:02 aciccarello

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: @.***>

CodeFoodPixels avatar Feb 24 '23 09:02 CodeFoodPixels