atlas-obscura-api 2.1.1 → 2.2.0
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atlas-obscura-api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Atlas Obscura API in JavaScript. NPM library for scrapping atlasobscura.com",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"author": "BART! <bart@bartweb.cz>",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"release:major": "git checkout master && npm version major -m \"chore(update): major release %s 💥\""
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"cross-fetch": "^
|
|
26
|
-
"node-html-parser": "^6.1.
|
|
25
|
+
"cross-fetch": "^4.0.0",
|
|
26
|
+
"node-html-parser": "^6.1.6"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"url": "git+https://github.com/bartholomej/atlas-obscura-api.git",
|
|
@@ -32,6 +32,7 @@ class PlacesScraper {
|
|
|
32
32
|
return place;
|
|
33
33
|
}
|
|
34
34
|
async placeFull(url) {
|
|
35
|
+
var _a;
|
|
35
36
|
const data = await (0, fetchers_1.fetchPage)(url);
|
|
36
37
|
const html = (0, node_html_parser_1.parse)(data);
|
|
37
38
|
const descriptions = html.querySelectorAll('#place-body p').map((p) => p.innerHTML);
|
|
@@ -45,7 +46,11 @@ class PlacesScraper {
|
|
|
45
46
|
link: x.attributes.href
|
|
46
47
|
};
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
+
const imageCover = (_a = html.querySelector('.js-contains-mobile-lightbox-link img')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-src');
|
|
50
|
+
const images = html
|
|
51
|
+
.querySelectorAll('.js-item-gallery figure a[data-lightbox-src]')
|
|
52
|
+
.map((x) => x.getAttribute('data-lightbox-src'));
|
|
53
|
+
return { description: descriptions, directions, tags, imageCover, images };
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
56
|
exports.PlacesScraper = PlacesScraper;
|