liftie 4.2.7 → 4.2.8

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.
@@ -1,12 +1,10 @@
1
1
  export default {
2
- selector: '.table:first-of-type th',
3
- filter: node => node.children.length >= 2,
2
+ selector: '.node--type-lift',
4
3
  parse: {
5
- name: 1,
4
+ name: '0/0/0',
6
5
  status: {
7
- child: 0,
8
- attribute: 'class',
9
- regex: /\s+([a-z]+)$/
6
+ child: 2,
7
+ attribute: 'title'
10
8
  }
11
9
  }
12
10
  };
@@ -2,7 +2,7 @@
2
2
  "name": "Grand Targhee",
3
3
  "url": {
4
4
  "host": "https://www.grandtarghee.com",
5
- "pathname": "/the-mountain/snow-report/"
5
+ "pathname": "/the-mountain/cams-conditions/lifts-trails-report"
6
6
  },
7
7
  "tags": [
8
8
  "Wyoming"
@@ -1,11 +1,9 @@
1
- export default {
2
- selector: 'div.wrapper > div.row',
3
- parse: {
4
- name: '2/0',
5
- status: {
6
- child: '.',
7
- attribute: 'data-state',
8
- fn: s => (s === '1' ? 'open' : 'closed')
9
- }
10
- }
11
- };
1
+ import coerce from '../../tools/coerce.js';
2
+
3
+ export default function parse(data = {}) {
4
+ const { items = [] } = data;
5
+ return items.reduce((ls, { title, state }) => {
6
+ ls[title] = coerce(state);
7
+ return ls;
8
+ }, {});
9
+ }
@@ -2,7 +2,18 @@
2
2
  "name": "Skiwelt",
3
3
  "url": {
4
4
  "host": "https://www.skiwelt.at",
5
- "pathname": "/dk/liftstatus.html"
5
+ "pathname": "/en/lift-status-winter.html"
6
+ },
7
+ "dataUrl": {
8
+ "host": "https://www.skiwelt.at",
9
+ "pathname": "/webapi/micadoweb",
10
+ "query": {
11
+ "api": "Micado.Ski.Web/Micado.Ski.Web.IO.Api.FacilityApi/List.api",
12
+ "region": "skiwelt",
13
+ "season": "winter",
14
+ "typeIDs": 1
15
+ },
16
+ "json": true
6
17
  },
7
18
  "tags": [
8
19
  "Alps",
@@ -1,7 +1,7 @@
1
1
  export default {
2
- selector: '.lifts_info',
2
+ selector: '.lift_status_top',
3
3
  parse: {
4
- name: 0,
5
- status: node => node.prev.children[0].attribs.alt
4
+ name: '0/0',
5
+ status: '1/0'
6
6
  }
7
7
  };
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "api": {
8
8
  "host": "https://www.skibanff.com",
9
- "pathname": "/api/data/lifts",
9
+ "pathname": "/wp-json/sunshine/v1/lifts",
10
10
  "json": true
11
11
  },
12
12
  "tags": [
@@ -1,3 +1,11 @@
1
1
  export default {
2
- selector: '.lift-listing .asset-container .asset'
2
+ selector: '.mc-lifts__table tbody tr',
3
+ parse: {
4
+ name: '0',
5
+ status: {
6
+ child: '2',
7
+ attribute: 'class',
8
+ regex: /mc__icon-(\w+)/
9
+ }
10
+ }
3
11
  };
@@ -2,7 +2,7 @@
2
2
  "name": "Sun Valley",
3
3
  "url": {
4
4
  "host": "https://www.sunvalley.com",
5
- "pathname": "/mountain-snow-report"
5
+ "pathname": "/the-mountain/mountain-report/"
6
6
  },
7
7
  "tags": [
8
8
  "Idaho"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "liftie",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "description": "Clean, simple, easy to read, fast ski resort lift status",
5
5
  "type": "module",
6
6
  "keywords": [