scraply 1.0.8 → 1.0.9
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 +1 -1
- package/src/defaultConfig.js +9 -9
- package/src/loadConfig.js +5 -0
package/package.json
CHANGED
package/src/defaultConfig.js
CHANGED
|
@@ -52,15 +52,15 @@ export const DEFAULT_CONFIG = {
|
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
HARD_CODED_LINKS: [
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
};
|