diff --git a/src/workers/parseWorker/resorts/__tests__/__fixtures__/diamond-weather.html.input b/src/workers/parseWorker/resorts/__tests__/__fixtures__/diamond-weather.html.input index a5e888b..103e367 100644 --- a/src/workers/parseWorker/resorts/__tests__/__fixtures__/diamond-weather.html.input +++ b/src/workers/parseWorker/resorts/__tests__/__fixtures__/diamond-weather.html.input @@ -1,25 +1,1592 @@ - Conditions | Diamond Peak Ski Resort

Conditions

0"
New Snow Overnight
0"
New Snow 24H Total
8"
New Snow Storm Total
6”
Base Depth
8”
Peak Depth
8”
Season Total
{alt_text}

Mountain Notes

Diamond Peak is closed for the 2019-20 season. Our projected opening is usually the first or second week in December. See you next winter!

Lift & Trail Conditions

Crystal Express - High-Speed Quad

Closed
Battle Born Closed
Crystal Ridge Closed
Diamond Back Closed
Golden Eagle Bowl Closed
Great Flume Closed
Lakeview Closed
Lightning Closed
Powder Closed
Solitude Canyon Closed
Spillway Closed
Sunnyside Closed
The Glades Closed
Thunder Closed

Lakeview Lift - Quad

Closed
Chute Closed
Corkscrew Closed
F.I.S. Closed
Freeway Closed
G.S. Closed
Lower Showoff Closed
O God Closed
Penguin Closed
Popular Closed
Ridge Run Closed
Slalom Glade Closed
Upper Showoff Closed
Wiggle Closed

Lodgepole Lift - Quad

Closed
Lodge Pole Closed

Red Fox Lift - Double

Closed

Ridge Chair - Double

Closed

Schoolhouse Lift - Double

Closed
School Yard Closed

Terrain Park

The Village - Central (Dusty's) Closed
The Village - North Closed
The Village - South Closed

Road Conditions

CalTrans (800) 427-7623

Get Road Conditions

NevadaDOT (877) NV-ROADS

Get Road Conditions

Driving Directions

Getting Here
\ No newline at end of file + + + + + + Conditions | Diamond Peak Ski Resort + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Skip to main content + + +
+ +
+ + + Book + + +
+
+
+ +
+ + + + +
+ +
+ +
+
+

+ Snow Report

+
+
+
3"
+
+ Overnight
+
+
+
6"
+
+ 24HR
+
+
+
6"
+
+ Storm Total
+
+
+ +

+ Depth

+
+
+
33"
+
+ Base
+
+
+
66"
+
+ Peak
+
+
+
173"
+
+ Season Total
+
+
+ + + View Full Report +
+
+
+
+
+
+
+
+
+
+
+

+ Mountain Report

+ + + +
+
+
+
New Snow Overnight
+
+ + 3 + Inches
+
+
+
New Snow 24H Total
+
+ + 6 + Inches
+
+
+
New Snow Storm Total
+
+ + 6 + Inches
+
+
+
Base Depth
+
+ + 33 + Inches
+
+
+
Peak Depth
+
+ + 66 + Inches
+
+
+
Season Total
+
+ + 173 + Inches
+
+
+
+ + + +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+

+ Lift & Trail Status

+
+ Mountain Notes

+ 1/14 @ 6:45am: The weather forecast is calling for more snow throughout the morning today. Come enjoy a powder day at Tahoe's community-owned resort, where lift lines are minimal and fun is maximized. // TERRAIN PARK UPDATE: Slopes is pulling features from Wiggle and will rebuild after the storm. Spillway park should be ready in the next week or so as well!
+
+
+
+
+ +
+ Easier +
+
+
+ +
+ Most Difficult +
+
+
+ +
+ More Difficult +
+
+
+ +
+ Off-piste Tree Skiiing / Riding +
+
+
+
+
+
+

+ Crystal Express - High-Speed Quad

+
+
+ open
+
+
+
+

+ Battle Born

+
+ + +
+
+
+ open
+
+
+
+

+ Crystal Ridge

+
+ + +
+
+
+ groomed
+
+
+
+

+ Diamondback

+
+ + +
+
+
+ groomed
+
+
+
+

+ Golden Eagle Bowl

+
+ + +
+
+
+ open
+
+
+
+

+ Great Flume

+
+ + +
+
+
+ groomed
+
+
+
+

+ Lakeview

+
+ + +
+
+
+ groomed
+
+
+
+

+ Lightning

+
+ + +
+
+
+ groomed
+
+
+
+

+ Luggi's

+
+ + +
+
+
+ groomed
+
+
+
+

+ Powder

+
+ + +
+
+
+ groomed
+
+
+
+

+ Spillway

+
+ + +
+
+
+ groomed
+
+
+
+

+ Sunnyside

+
+ + +
+
+
+ groomed
+
+
+
+

+ Thunder

+
+ + +
+
+
+ open
+
+
+
+

+ Area del Fuego

+
+ + +
+
+
+ open
+
+
+
+

+ Boarder Line

+
+ + +
+
+
+ open
+
+
+
+

+ Bonanza

+
+ + +
+
+
+ open
+
+
+
+

+ Elevator Shaft

+
+ + +
+
+
+ open
+
+
+
+

+ Glade Runner

+
+ + +
+
+
+ open
+
+
+
+

+ Gnarnia

+
+ + +
+
+
+ open
+
+
+
+

+ Nirvana

+
+ + +
+
+
+ open
+
+
+
+

+ Outer Limits

+
+ + +
+
+
+ open
+
+
+
+

+ Promised Land

+
+ + +
+
+
+ open
+
+
+
+

+ Rollerglades

+
+ + +
+
+
+ open
+
+
+
+

+ Solitude Canyon

+
+ + +
+
+
+ open
+
+
+
+

+ The Crown Jewels

+
+ + +
+
+
+ open
+
+
+
+

+ Lakeview Lift - Quad

+
+
+ open
+
+
+
+

+ Chute

+
+ + +
+
+
+ groomed
+
+
+
+

+ Corkscrew

+
+ + +
+
+
+ groomed
+
+
+
+

+ Dusty's

+
+ + +
+
+
+ groomed
+
+
+
+

+ F.I.S.

+
+ + +
+
+
+ groomed
+
+
+
+

+ Freeway

+
+ + +
+
+
+ groomed
+
+
+
+

+ G.S.

+
+ + +
+
+
+ open
+
+
+
+

+ Lower Show Off

+
+ + +
+
+
+ groomed
+
+
+
+

+ O God

+
+ + +
+
+
+ open
+
+
+
+

+ Penguin

+
+ + +
+
+
+ groomed
+
+
+
+

+ Popular

+
+ + +
+
+
+ groomed
+
+
+
+

+ Ridge Run

+
+ + +
+
+
+ groomed
+
+
+
+

+ Slalom Glade

+
+ + +
+
+
+ groomed
+
+
+
+

+ Upper Show Off

+
+ + +
+
+
+ groomed
+
+
+
+

+ Wiggle

+
+ + +
+
+
+ groomed
+
+
+
+

+ Cappy's Corner

+
+ + +
+
+
+ open
+
+
+
+

+ Zig Zag

+
+ + +
+
+
+ open
+
+
+
+

+ Lodgepole Lift - Quad

+
+
+ open
+
+
+
+

+ Lodgepole

+
+ + +
+
+
+ groomed
+
+
+
+

+ Pete's Powerline

+
+
+ open
+
+
+
+

+ Red Fox Lift - Double

+
+
+ closed
+
+
+
+

+ Ridge Chair - Double

+
+
+ closed
+
+
+
+

+ Schoolhouse Lift - Double

+
+
+ open
+
+
+
+

+ School Yard

+
+ + +
+
+
+ groomed
+
+
+
+

+ Terrain Parks

+
+
+
+
+
+
+

+ The Village - Jump Start

+
+
+ closed
+
+
+
+

+ The Village - Spillway

+
+
+ closed
+
+
+
+

+ The Village - Wiggle

+
+
+ open
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+

Lifts are scheduled to run 9:00 a.m. - 4:00 p.m. daily. Pete's Powerline surface lift is a dedicated lift for Child Ski & Ride Center lessons only. 

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+

+ Diamond Peak Summit Cam

+

+

+ + View Summit Cam +
+
+

+ Snowflake Lodge Cams

+

+

+ + View Snowflake Cams +
+
+

+ Lower Show Off Cam

+

+

+ + View Base Area Cams +
+
+
+
+ +
+
+
+
+ +
+
+
+

+ Diamond Peak Trail Map

+
+

Explore Diamond Peak before you visit.

+
+ + View Trail Map +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+

+ Season Passes and Tickets

+ + + Shop Now +
+
+
+ +
+

+ Subscribe to Powder Alert Emails

+ + + Sign Up +
+
+
+
+
+ +
+
+
+
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/workers/parseWorker/resorts/__tests__/__snapshots__/diamond-test.js.snap b/src/workers/parseWorker/resorts/__tests__/__snapshots__/diamond-test.js.snap index 5fe6228..3c69885 100644 --- a/src/workers/parseWorker/resorts/__tests__/__snapshots__/diamond-test.js.snap +++ b/src/workers/parseWorker/resorts/__tests__/__snapshots__/diamond-test.js.snap @@ -6,17 +6,22 @@ Object { Object { "category": null, "name": "Crystal Express - High-Speed Quad", - "status": "closed", + "status": "open", }, Object { "category": null, "name": "Lakeview Lift - Quad", - "status": "closed", + "status": "open", }, Object { "category": null, "name": "Lodgepole Lift - Quad", - "status": "closed", + "status": "open", + }, + Object { + "category": null, + "name": "Pete's Powerline", + "status": "open", }, Object { "category": null, @@ -31,11 +36,11 @@ Object { Object { "category": null, "name": "Schoolhouse Lift - Double", - "status": "closed", + "status": "open", }, Object { "category": null, - "name": "Terrain Park", + "name": "Terrain Parks", "status": null, }, ], @@ -49,187 +54,271 @@ Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "Battle Born", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Crystal Ridge", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", - "name": "Diamond Back", - "status": "closed", + "name": "Diamondback", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", - "level": "intermediate", + "level": "advanced", "name": "Golden Eagle Bowl", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Great Flume", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Lakeview", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "Lightning", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", - "name": "Powder", - "status": "closed", + "name": "Luggi's", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", - "name": "Solitude Canyon", - "status": "closed", + "name": "Powder", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Spillway", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Sunnyside", - "status": "closed", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", - "name": "The Glades", - "status": "closed", + "name": "Thunder", + "status": "open", }, Object { "category": "Crystal Express - High-Speed Quad", "level": "advanced", - "name": "Thunder", - "status": "closed", + "name": "Area del Fuego", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Boarder Line", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Bonanza", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Elevator Shaft", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Glade Runner", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Gnarnia", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Nirvana", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Outer Limits", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Promised Land", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Rollerglades", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Solitude Canyon", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "The Crown Jewels", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "Chute", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "Corkscrew", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", + "level": "intermediate", + "name": "Dusty's", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "F.I.S.", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "beginner", "name": "Freeway", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "G.S.", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "intermediate", - "name": "Lower Showoff", - "status": "closed", + "name": "Lower Show Off", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "O God", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Penguin", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Popular", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Ridge Run", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "advanced", "name": "Slalom Glade", - "status": "closed", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "advanced", - "name": "Upper Showoff", - "status": "closed", + "name": "Upper Show Off", + "status": "open", }, Object { - "category": "Lakeview Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "intermediate", "name": "Wiggle", - "status": "closed", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Cappy's Corner", + "status": "open", + }, + Object { + "category": "Crystal Express - High-Speed Quad", + "level": "advanced", + "name": "Zig Zag", + "status": "open", }, Object { - "category": "Lodgepole Lift - Quad", + "category": "Crystal Express - High-Speed Quad", "level": "beginner", - "name": "Lodge Pole", - "status": "closed", + "name": "Lodgepole", + "status": "open", }, Object { - "category": "Schoolhouse Lift - Double", + "category": "Crystal Express - High-Speed Quad", "level": "beginner", "name": "School Yard", - "status": "closed", + "status": "open", }, Object { - "category": "Terrain Park", + "category": "Crystal Express - High-Speed Quad", "level": null, - "name": "Closed", - "status": null, + "name": "The Village - Jump Start", + "status": "closed", }, Object { - "category": "Terrain Park", + "category": "Crystal Express - High-Speed Quad", "level": null, - "name": "Closed", - "status": null, + "name": "The Village - Spillway", + "status": "closed", }, Object { - "category": "Terrain Park", + "category": "Crystal Express - High-Speed Quad", "level": null, - "name": "Closed", - "status": null, + "name": "The Village - Wiggle", + "status": "open", }, ], } diff --git a/src/workers/parseWorker/resorts/__tests__/diamond-test.js b/src/workers/parseWorker/resorts/__tests__/diamond-test.js index df40b47..d232ac3 100644 --- a/src/workers/parseWorker/resorts/__tests__/diamond-test.js +++ b/src/workers/parseWorker/resorts/__tests__/diamond-test.js @@ -18,9 +18,9 @@ test('fetches Diamond snow data correctly', async () => { weatherIcon: null, temperature: null, baseCondition: null, - newSnow: 0, - snowDepthBase: 6, - snowDepthSummit: 8, + newSnow: 6, + snowDepthBase: 33, + snowDepthSummit: 66, }, }); }); diff --git a/src/workers/parseWorker/resorts/diamond.js b/src/workers/parseWorker/resorts/diamond.js index 037e4eb..3360256 100644 --- a/src/workers/parseWorker/resorts/diamond.js +++ b/src/workers/parseWorker/resorts/diamond.js @@ -33,18 +33,21 @@ export const parseDiamondSnow = async ($) => { const weatherIcon = $('.weather-condition .weather-condition-wrapper .weather-forecast').first().text().trim(); const temperature = $('.conditions-overlay .row.weather-row .large-4.columns').first().text().trim(); // 24 Hours - const newSnow24Hr = $('.conditions-overlay .row.weather-row .large-4.columns .weather-data').slice(1, 2).text().trim(); + const newSnow24Hr = $('.report div dd').slice(1, 2).text().trim() + .split(' ')[0]; // Base - const snowDepthBase = $('.conditions-overlay .row.weather-row .large-4.columns .weather-data').slice(3, 4).text().trim(); - const snowDepthSummit = $('.conditions-overlay .row.weather-row .large-4.columns .weather-data').slice(4, 5).text().trim(); + const snowDepthBase = $('.report div dd').slice(3, 4).text().trim() + .split(' ')[0]; + const snowDepthSummit = $('.report div dd').slice(4, 5).text().trim() + .split(' ')[0]; return { ...initialWeather, weatherIcon: weatherStatusOrNull(weatherIcon), status: resortStatusOrNull(status), temperature: degreeOrNull(temperature), - newSnow: inchOrNull(newSnow24Hr), - snowDepthBase: inchOrNull(snowDepthBase), - snowDepthSummit: inchOrNull(snowDepthSummit), + newSnow: inchOrNull(newSnow24Hr, { omitUnitSign: true }), + snowDepthBase: inchOrNull(snowDepthBase, { omitUnitSign: true }), + snowDepthSummit: inchOrNull(snowDepthSummit, { omitUnitSign: true }), }; }; @@ -63,12 +66,12 @@ export const parseDiamondTrailCounts = async () => { export const parseDiamondLifts = async ($) => { const list = []; - $('.lift-trail-conditions .lift-header').each((index, rowElement) => { - const h1Elements = $(rowElement).find('h1'); - const spanElements = $(rowElement).find('span'); + $('.conditions .conditions__row--header').each((index, rowElement) => { + const h3Elements = $(rowElement).find('.conditions__name'); + const divlements = $(rowElement).find('.conditions__status'); - const name = notEmptyStringOrNull($(h1Elements).text().trim()); - const status = liftTrailStatusOrNull($(spanElements).text().trim()); + const name = notEmptyStringOrNull($(h3Elements).text().trim()); + const status = liftTrailStatusOrNull($(divlements).text().trim()); const category = null; const lift = { @@ -86,20 +89,14 @@ export const parseDiamondLifts = async ($) => { export const parseDiamondTrails = async ($) => { const list = []; - $('.trail').each((index, rowElement) => { - const spanElements = $(rowElement).find('span'); + $('.conditions .conditions__row:not(.conditions__row--header)').each((index, rowElement) => { + // const parentElement = rowElement.parent.parent.parent; + const h3ElementCategory = $(rowElement).prevAll('.conditions__row--header').slice(-1).find('.conditions__name'); - const spanElementName = spanElements[1]; - const spanElementStatus = spanElements[2]; - const spanElementLevel = spanElements[0]; - - const parentElement = rowElement.parent.parent.parent; - const h1ElementCategory = $(parentElement).prev().find('.lift-header').find('h1'); - - const name = notEmptyStringOrNull($(spanElementName).text().trim()); - const status = liftTrailStatusOrNull($(spanElementStatus).text().trim()); - const level = trailLevelOrNull($(spanElementLevel).attr('class')); - const category = notEmptyStringOrNull($(h1ElementCategory).text().trim()); + const name = notEmptyStringOrNull($(rowElement).find('.conditions__name').text().trim()); + const status = liftTrailStatusOrNull($(rowElement).find('.conditions__status').text().trim()); + const level = trailLevelOrNull($(rowElement).find('.conditions__rating span').attr('class')); + const category = notEmptyStringOrNull($(h3ElementCategory).text().trim()); const trail = { name, diff --git a/src/workers/parseWorker/weatherUtil.js b/src/workers/parseWorker/weatherUtil.js index 7389438..781df7a 100644 --- a/src/workers/parseWorker/weatherUtil.js +++ b/src/workers/parseWorker/weatherUtil.js @@ -17,6 +17,7 @@ const ADVANCED_LEVEL = [ 'mostdifficult', 'diamond', 'type_3', + 'tree', ]; const EXPERT_LEVEL = ['expert', 'double', 'type_4'];