scraply 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "scraply",
3
3
  "description": "A simple, configurable and functional content scraper",
4
- "version": "1.0.8",
4
+ "version": "1.0.10",
5
5
  "main": "src/scraply.js",
6
6
  "type": "module",
7
7
  "scripts": {
package/readme.md CHANGED
@@ -2,6 +2,7 @@
2
2
  Scraply is a customizable and efficient web crawler and data scraper for Node.js, designed to handle various web crawling needs with ease. You can define the URLs to crawl, configure patterns to include/exclude, and format the output data in JSON. Scraply is built to be flexible, with user-configurable settings and dynamic paths.
3
3
 
4
4
  Bug Reports & Dev Stuff on: [Scraply's GitHub](https://github.com/pauserratgutierrez/scraply)
5
+ NPM Package: [Scraply's NPM](https://www.npmjs.com/package/scraply)
5
6
 
6
7
  ## Installation
7
8
  Using npm:
@@ -52,15 +52,15 @@ export const DEFAULT_CONFIG = {
52
52
  },
53
53
  },
54
54
  HARD_CODED_LINKS: [
55
- {
56
- file_name: 'hc-links.json',
57
- data: [
58
- {
59
- "url": "https://custom-link.com",
60
- "content": "That's a custom link content, you can add as many as you want."
61
- },
62
- ]
63
- }
55
+ // {
56
+ // file_name: 'hc-links.json',
57
+ // data: [
58
+ // {
59
+ // "url": "https://custom-link.com",
60
+ // "content": "That's a custom link content, you can add as many as you want."
61
+ // },
62
+ // ]
63
+ // }
64
64
  ]
65
65
  }
66
66
  };
package/src/loadConfig.js CHANGED
@@ -26,5 +26,10 @@ export function loadConfig(userConfig = {}) {
26
26
  config.CRAWLER.INCLUDE_URLS = config.CRAWLER.INITIAL_URLS.map(url => `${url}.*`);
27
27
  }
28
28
 
29
+ // If HARD_CODED_LINKS is missing, set to an empty array by default
30
+ if (!config.DATA_FORMATTER.HARD_CODED_LINKS) {
31
+ config.DATA_FORMATTER.HARD_CODED_LINKS = [];
32
+ }
33
+
29
34
  return config;
30
35
  };