liftie 4.1.0 → 4.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.
@@ -1,35 +1,9 @@
1
- import Debug from 'debug';
2
- import select from '../../select.js';
3
- import coerce from '../../tools/coerce.js';
4
- import * as domutil from '../../tools/domutil.js';
5
-
6
- const debug = Debug('liftie:resort:brettonwoods');
7
-
8
- function parse(dom) {
9
- const liftStatus = {};
10
-
11
- select(dom, '#trail-content > div:nth-of-type(-n + 2)').forEach(div => {
12
- let name;
13
- let status;
14
-
15
- div.children.forEach(node => {
16
- if (node.type === 'text') {
17
- name = domutil.findText(node);
18
- if (name) {
19
- name = name.trim().replace(/\s+High-Speed Quad$/, '');
20
- }
21
- } else if (node.type === 'tag' && node.name === 'span') {
22
- status = node.attribs.class || 'open';
23
- if (name) {
24
- liftStatus[name] = coerce(status);
25
- name = undefined;
26
- }
27
- }
28
- });
29
- });
30
-
31
- debug('Bretton Woods Lift Status:', liftStatus);
32
- return liftStatus;
33
- }
34
-
35
- export default parse;
1
+ export default {
2
+ selector: '.trail-reports__lifts .trail-reports__table-item[data-status]',
3
+ parse: {
4
+ name: '0/0',
5
+ status: {
6
+ attribute: 'data-status'
7
+ }
8
+ }
9
+ };
@@ -2,7 +2,7 @@
2
2
  "name": "Bretton Woods",
3
3
  "url": {
4
4
  "host": "https://www.brettonwoods.com",
5
- "pathname": "/alpine_trails/trail_report"
5
+ "pathname": "/snow-trail-report/"
6
6
  },
7
7
  "tags": [
8
8
  "New Hampshire",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "liftie",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Clean, simple, easy to read, fast ski resort lift status",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@pirxpilot/connect": "^5.0.0",
32
- "@pirxpilot/cookie-parser": "~2",
32
+ "@pirxpilot/cookie-parser": "~3",
33
33
  "@pirxpilot/jade-core": "^1.12.1",
34
34
  "@pirxpilot/k": "^1.0.0",
35
35
  "@pirxpilot/router": "~2",
@@ -58,7 +58,7 @@
58
58
  "to-title-case": "^1.0.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@biomejs/biome": "2.3.8",
61
+ "@biomejs/biome": "2.3.10",
62
62
  "@pirxpilot/stylus": "^1.2.0",
63
63
  "commander": "~14",
64
64
  "postcss": "~8",