Pinning only the resources required for a webpage (and not the whole website recursively)

Hi, are there any tools that can analyze an IPFS path, parse a webpage, and pin all the resources that website references?

Say I want to pin e.g. ipfs://hash/blog/example.html. I obviously need to non-recursively pin the CIDs of ipfs://hash/, ipfs://hash/blog/, and ipfs://hash/blog/example.html.

However, the last CID is kind of useless on its own. It uses relative links (as recommended by the IPFS docs) to references stylesheets and images hosted on ipfs://hash/images/example.png and ipfs://hash/assets/example.css.

So, are there any tools that can work out exactly what CIDs I need to pin for that one page to work without recursively pinning all of ipfs://hash/? I guess I’m asking for the IPFS equivalent of wget --mirror --page-requisites. Thanks!

Example: ipfs://bafybeifpyppkishqjofl6ahn6ky7udxuo5gn7s7fuzegrncfkm2ltevac4/concepts/what-is-ipfs/

according to your title The way I do this is I wrote the code for it in my application