Skip to content

Commit

Permalink
Update for Powdr resorts API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jinschoi committed Nov 16, 2024
1 parent a53e2e7 commit b878702
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 92 deletions.
2 changes: 1 addition & 1 deletion lib/resorts/boreal/resort.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"api": {
"host": "https://api.rideboreal.com",
"pathname": "/api/v1/dor/status"
"pathname": "/api/v1/dor/drupal/lifts"
},
"tags": [
"California",
Expand Down
2 changes: 1 addition & 1 deletion lib/resorts/copper/resort.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"api": {
"host": "https://api.coppercolorado.com",
"pathname": "/api/v1/dor/status"
"pathname": "/api/v1/dor/drupal/lifts"
},
"tags": [
"Colorado",
Expand Down
2 changes: 1 addition & 1 deletion lib/resorts/killington/resort.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"api": {
"host": "https://api.killington.com",
"pathname": "/api/v1/dor/status"
"pathname": "/api/v1/dor/drupal/lifts"
},
"tags": [
"New England",
Expand Down
2 changes: 1 addition & 1 deletion lib/resorts/mtbachelor/resort.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"api": {
"host": "https://api.mtbachelor.com",
"pathname": "/api/v1/dor/status"
"pathname": "/api/v1/dor/drupal/lifts"
},
"tags": [
"Oregon",
Expand Down
2 changes: 1 addition & 1 deletion lib/resorts/pico/resort.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"api": {
"host": "https://api.picomountain.com",
"pathname": "/api/v1/dor/status"
"pathname": "/api/v1/dor/drupal/lifts"
},
"tags": [
"Vermont",
Expand Down
11 changes: 3 additions & 8 deletions lib/tools/powdr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ module.exports = parse;
function parse(data) {
const liftStatus = {};

data
.filter(({ type }) => type === 'lift')
.forEach(({ properties: { name }, status }) => {
const si = status.find(({ status_name }) => status_name === 'opening');
if (si) {
liftStatus[name] = coerce(si.status_value);
}
});
data.forEach(({ name, status }) => {
liftStatus[name] = coerce(status);
});

debug('Lift Status:', liftStatus);
return liftStatus;
Expand Down
15 changes: 8 additions & 7 deletions test/resorts/boreal.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const lifts = require('../lifts');

lifts('boreal', 'json', {
'Accelerator Express Quad Charilift': 'open',
'Castle Peak Quad Chairlift': 'open',
'California Cruiser Quad Chairlift': 'open',
'Discovery Carpet': 'open',
'Cedar Ridge Triple Chairlift': 'open',
'49er Triple Chairlift': 'open',
'Lost Dutchman Triple Chairlift': 'open'
'49er Triple Chairlift': 'closed',
'Accelerator Express Quad Charilift': 'closed',
'California Cruiser Quad Chairlift': 'closed',
'Castle Peak Quad Chairlift': 'closed',
'Cedar Ridge Triple Chairlift': 'closed',
'Discovery Carpet': 'closed',
'Lost Dutchman Triple Chairlift': 'closed',
'Tahoe Tubing Carpet': 'closed'
});
46 changes: 23 additions & 23 deletions test/resorts/copper.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
const lifts = require('../lifts');

lifts('copper', 'json', {
'American Eagle': 'open',
'American Flyer': 'open',
Excelerator: 'open',
'Kokomo Express': 'open',
Lumberjack: 'open',
Rugrat: 'open',
'Slingshot/Glide': 'open',
'Timberline Express': 'open',
'Woodward Express': 'open',
Alpine: 'open',
'Stinger Too': 'open',
'Super Bee': 'open',
'Easy Rider': 'open',
Gem: 'open',
Pitchfork: 'open',
'Celebrity Ridge': 'open',
Rendezvous: 'open',
Sierra: 'open',
Resolution: 'open',
'Storm King': 'open',
'Three Bears': 'hold',
'Black Jack': 'open',
'Mountain Chief': 'open'
'American Eagle': 'open',
'American Flyer': 'closed',
'Black Jack': 'closed',
'Celebrity Ridge': 'closed',
'Easy Rider': 'open',
'Kokomo Express': 'closed',
'Mountain Chief': 'closed',
'Slingshot/Glide': 'closed',
'Stinger Too': 'closed',
'Storm King': 'open',
'Super Bee': 'closed',
'Three Bears': 'closed',
'Timberline Express': 'closed',
'Woodward Express': 'closed',
Alpine: 'closed',
Excelerator: 'open',
Gem: 'open',
Lumberjack: 'closed',
Pitchfork: 'open',
Rendezvous: 'closed',
Resolution: 'closed',
Rugrat: 'closed',
Sierra: 'closed'
});
2 changes: 1 addition & 1 deletion test/resorts/example/boreal.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/resorts/example/copper.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/resorts/example/killington.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/resorts/example/mtbachelor.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/resorts/example/pico.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions test/resorts/killington.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
const lifts = require('../lifts');

lifts('killington', 'json', {
'K-1 Express Gondola': 'scheduled',
'Needles Eye Express Quad': 'scheduled',
'Northbrook Quad': 'scheduled',
'Skye Peak Express Quad': 'scheduled',
'Skyeship Express Gondola Stage I': 'scheduled',
'Skyeship Express Gondola Stage II': 'scheduled',
'Superstar Express Quad': 'scheduled',
'Snowdon Six Express': 'scheduled',
'Snowdon Triple': 'scheduled',
'North Ridge Quad': 'scheduled',
'Canyon Quad': 'scheduled',
'Alpine Training Venue Poma': 'closed',
'Progression Carpet I': 'scheduled',
'Progression Carpet II': 'scheduled',
'Ramshead Express Quad': 'scheduled',
'Learn To Carpet': 'scheduled',
'Snowshed Double': 'scheduled',
'Snowshed Express Quad': 'scheduled',
'Bear Mountain Quad': 'scheduled',
'South Ridge Quad': 'scheduled',
'Sunrise Village Triple': 'scheduled',
'Tubing Park Tow': 'closed'
'Alpine Training Venue Poma': 'closed',
'Bear Mountain Quad': 'closed',
'Canyon Quad': 'closed',
'K-1 Express Gondola': 'scheduled',
'Learn To Carpet': 'closed',
'Needles Eye Express Quad': 'closed',
'North Ridge Quad': 'scheduled',
'Northbrook Quad': 'closed',
'Progression Carpet I': 'closed',
'Progression Carpet II': 'closed',
'Ramshead Express Quad': 'closed',
'Skye Peak Express Quad': 'closed',
'Skyeship Express Gondola Stage I': 'closed',
'Skyeship Express Gondola Stage II': 'closed',
'Snowdon Six Express': 'closed',
'Snowdon Triple': 'closed',
'Snowshed Double': 'closed',
'Snowshed Express Quad': 'closed',
'South Ridge Quad': 'closed',
'Sunrise Village Triple': 'closed',
'Superstar Express Quad': 'closed',
'Tubing Park Tow': 'closed'
});
32 changes: 17 additions & 15 deletions test/resorts/mtbachelor.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
const lifts = require('../lifts');

lifts('mtbachelor', 'json', {
'Chipmunk Carpet': 'scheduled',
'Little Pine': 'scheduled',
'Pine Marten': 'scheduled',
'Red Chair': 'scheduled',
'Skyliner Express': 'scheduled',
'Alpenglow': 'scheduled',
'Cloudchaser': 'scheduled',
'Early Riser': 'scheduled',
'First Rays': 'closed',
'Lava Tube': 'scheduled',
'Rainbow': 'scheduled',
'Summit': 'scheduled',
'Sunrise': 'scheduled',
'Northwest': 'scheduled',
'Outback': 'scheduled'
'Chipmunk Carpet': 'closed',
'Early Riser': 'closed',
'First Rays': 'closed',
'Lava Tube': 'closed',
'Little Pine (Summer)': 'closed',
'Little Pine (Winter) ': 'closed',
'Pine Marten (Summer)': 'closed',
'Pine Marten (Winter)': 'closed',
'Red Chair': 'closed',
'Skyliner Express': 'closed',
Alpenglow: 'closed',
Cloudchaser: 'closed',
Northwest: 'closed',
Outback: 'closed',
Rainbow: 'closed',
Summit: 'closed',
Sunrise: 'closed'
});
14 changes: 7 additions & 7 deletions test/resorts/pico.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const lifts = require('../lifts');

lifts('pico', 'json', {
'Bonanza Double': 'scheduled',
'Bonanza Rope Tow': 'scheduled',
'Golden Express Quad': 'scheduled',
'Knomes Knoll Triple': 'scheduled',
'Little Pico Triple': 'scheduled',
'Outpost Double': 'scheduled',
'Summit Express Quad': 'scheduled'
'Bonanza Double': 'closed',
'Bonanza Rope Tow': 'closed',
'Golden Express Quad': 'closed',
'Knomes Knoll Triple': 'closed',
'Little Pico Triple': 'closed',
'Outpost Double': 'closed',
'Summit Express Quad': 'closed'
});

0 comments on commit b878702

Please sign in to comment.