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
 
@@ -18,6 +18,7 @@ export interface PlaceShort {
18
18
  export interface PlaceExtend {
19
19
  description?: string[];
20
20
  tags?: Tag[];
21
+ directions?: string[];
21
22
  }
22
23
  export interface Tag {
23
24
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-obscura-api",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
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>",
@@ -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;