atlas-obscura-api 2.0.0 → 2.1.1
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/README.md
CHANGED
|
@@ -161,11 +161,12 @@ atlasobscura.placeFull(494).then((place) => console.log(place));
|
|
|
161
161
|
|
|
162
162
|
#### Results
|
|
163
163
|
|
|
164
|
-
Same as short but with full description, tags and more, ... (TBD)
|
|
164
|
+
Same as short but with full description, tags, directions and more, ... (TBD)
|
|
165
165
|
|
|
166
166
|
## Used by
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
- Atlas Obscura Offline mobile app (Android, iOS)
|
|
169
|
+
- 🤷
|
|
169
170
|
|
|
170
171
|
## Development
|
|
171
172
|
|
package/package.json
CHANGED
|
@@ -35,13 +35,17 @@ class PlacesScraper {
|
|
|
35
35
|
const data = await (0, fetchers_1.fetchPage)(url);
|
|
36
36
|
const html = (0, node_html_parser_1.parse)(data);
|
|
37
37
|
const descriptions = html.querySelectorAll('#place-body p').map((p) => p.innerHTML);
|
|
38
|
+
const directions = html
|
|
39
|
+
.querySelectorAll('.DDP__direction-copy p')
|
|
40
|
+
.map((p) => p.innerHTML)
|
|
41
|
+
.filter((x) => x !== '');
|
|
38
42
|
const tags = html.querySelectorAll('.item-tags a.itemTags__link').map((x) => {
|
|
39
43
|
return {
|
|
40
44
|
title: x.innerHTML.trim(),
|
|
41
45
|
link: x.attributes.href
|
|
42
46
|
};
|
|
43
47
|
});
|
|
44
|
-
return { description: descriptions, tags: tags };
|
|
48
|
+
return { description: descriptions, directions: directions, tags: tags };
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
exports.PlacesScraper = PlacesScraper;
|