node-website-scraper icon indicating copy to clipboard operation
node-website-scraper copied to clipboard

Wildcard for files subdirectories

Open perazzi opened this issue 8 years ago • 3 comments

This is not an issue, rather a feature request. I think that the subdirectories is pretty cool. I was trying to keep all the included files separate from the actual index.html file, but if in order to do so, I'd need to create a huge array with all file extensions, pointing to the same directory. I'd like to suggest a wildcard ".*", so that all files (except index, which would go to would go to directory.

So fo example if I said:

scrape({
  urls: ['http://example.com'],
  directory: '/path/to/save',
  subdirectories: [
    {directory: 'resources', extensions: ['.*']},
    {directory: 'js', extensions: ['.js']}
  ]
}).then(console.log).catch(console.log);

all files would go to /resources, while js files would ggo to /js.

perazzi avatar Mar 26 '18 18:03 perazzi

Hey @perazzi Thanks for suggestion, good idea 👍 Contributions are welcome

s0ph1e avatar Mar 26 '18 20:03 s0ph1e

Yeah, I was sketching something to open a PR.. Still getting used to the code

perazzi avatar Mar 26 '18 20:03 perazzi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 24 '18 15:10 stale[bot]