From fe6185890b18d7496ce7090e0f63af1ae824257c Mon Sep 17 00:00:00 2001 From: Damian Krzeminski Date: Mon, 18 May 2020 20:27:57 +0200 Subject: [PATCH] add scaffold for Timberline Lodge --- lib/resorts/timberline-lodge/index.js | 13 + lib/resorts/timberline-lodge/resort.json | 15 + test/resorts/example/timberline-lodge.html | 2376 ++++++++++++++++++++ test/resorts/timberline-lodge.js | 21 + 4 files changed, 2425 insertions(+) create mode 100644 lib/resorts/timberline-lodge/index.js create mode 100644 lib/resorts/timberline-lodge/resort.json create mode 100644 test/resorts/example/timberline-lodge.html create mode 100644 test/resorts/timberline-lodge.js diff --git a/lib/resorts/timberline-lodge/index.js b/lib/resorts/timberline-lodge/index.js new file mode 100644 index 00000000..554b4a11 --- /dev/null +++ b/lib/resorts/timberline-lodge/index.js @@ -0,0 +1,13 @@ +module.exports = { + selector: '.lifts', // selector for lift information + filter: node => node.children, // optional - skip nodes for which filter retuturns nodes + parse: { + name: '0/1', // example of a simple path descriptor - index, ',', '..', '+', '-' are supported + status: { // example of a compound descriptor child. attribute, regex, fn - can be specified + child: '+/1', + attribute: 'alt', + regex: /-([a-z]+)$/, + fn: s => s.slice(0, -3) + } + } +}; diff --git a/lib/resorts/timberline-lodge/resort.json b/lib/resorts/timberline-lodge/resort.json new file mode 100644 index 00000000..fe43a427 --- /dev/null +++ b/lib/resorts/timberline-lodge/resort.json @@ -0,0 +1,15 @@ +{ + "name": "Timberline Lodge", + "url": { + "host": "https://www.timberlinelodge.com", + "pathname": "/conditions" + }, + "tags": [ + "Oregon" + ], + "ll": [ + -121.71, + 45.33 + ], + "twitter": "timberlinelodge" +} \ No newline at end of file diff --git a/test/resorts/example/timberline-lodge.html b/test/resorts/example/timberline-lodge.html new file mode 100644 index 00000000..2e0595b3 --- /dev/null +++ b/test/resorts/example/timberline-lodge.html @@ -0,0 +1,2376 @@ + + + + Conditions | Timberline Lodge + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
Conditions
+
+
+
+
+
Current Conditions:
+
+
+

May 18 - Updated at 11:02 am

+
+
+
+
36
+
Snow / Rain Mix
+
+
+ +
+
+
+
Today at Timberline:
+

Lifts are scheduled to operate from 9am - 2pm, weather permitting. Reservations are required.
+

+All skiers and riders are required to make a mandatory reservation prior to visiting Timberline. During this initial phase of re-opening, ski area capacity will be limited by a daily reservation allotment. Reservations cannot be made more than 24 hours in advance and are sold on a first-come-first-served basis. Operations may be limited or modified at any time in response to changing circumstances. There will be absolutely no refunds or rain checks. Please stay tuned for updates. Click here for the most up to date information & FAQ +

+Update May 12: On our initial opening, uphill traffic will not be allowed in the active part of the Timberline Ski Area and is only permitted on the climbers route, located on the east side of the Timberline permit area, accessed from the Salmon River parking lot. Timberline is operating the ski area and hotel with a very measured and cautious approach. We are hopeful uphill traffic visitors practice similar measures with their mindsets and activities.

+
+
+
    +
  • Please familiarize yourself with deep snow safety. Uphill travel is only allowed on designated routes. MOUNTAIN SAFETY
  • +
+
+
+
New Snow:
+
+
+   +
+
0"
+
Since 5am
+
0"
+
Last 24 hrs (5am to 5am)
+
0"
+
Last 72 hrs
+
109"
+
Base depth at lodge
+
+
+
    +
  • CAUTION: You are entering an Alpine Environment where ice, snow, and irregular conditions may exist at any time on any surface. LEARN MORE about getting here.
  • +
+
+
+
At The Lodge:
+
+
+   +
+
Webcam Icon 5 webcams
+
Click here to view
+
Wet Roads
+
Please take your time and drive with care. Winter driving conditions can exist. +
+
+Camping is not permitted in the Timberline parking lot or within the area boundary.
+
Light Wind
+
NW @ 6mph
+ +
416"
+
Annual snowfall
+
+
+
    +
  • Annual snowfall calculated since September 1st.
  • +
  • Sledding, tubing, tobogganing, sliding, and camping are not permitted in the Timberline permit area.
  • +
+
+
+
+ +
+ Operating Status +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LiftsStatusOperating Hours
STORMIN’ NORMAN + open +
+ 9:00am - 2:00pm +
9:00am - 2:00pm
MAGIC MILE + open +
+ 9:00am - 1:30pm +
9:00am - 1:30pm
PALMER + Under Construction +
+ 10:00am - 2:30pm +
10:00am - 2:30pm
+ + + + + + + + + + + + + + + + + + + + + + +
TerrainStatusOperating Hours
BLOSSOM + closed +
+ 9:00am - 2:00pm +
9:00am - 2:00pm
CONWAY’S + closed +
+ 9:00am - 2:00pm +
9:00am - 2:00pm
+ + + + + + + + + + + + + + + + + + + + + + +
Parking LotsStatusLast Updated
MAIN LOT + open +
+ updated:
7:00am
+
7:00am
SALMON RIVER LOT + open +
+ updated:
7:00am
+
7:00am
+
+ + +
+ Telemetry +
+
+
+
+
+
+ NWAC logo +
+
+
+ Current Telemetry Data from NWAC +
+
+
+ + +
+
+ Webcams +
+
+
+
+ + Live Feed: Timberline Lodge Camera + +
+
Timberline Lodge
+
+
+
+ + Live Feed: Jeff Flood Camera + +
+
Magic Mile
+
+
+
+ + Live Feed: Palmer/Silcox Camera + +
+
Palmer/Silcox
+
+
+
+ + Live Feed: Bruno's Camera + +
+
Bruno's
+
+
+
+ Weather Resources +
+ +
+ Snow Data +
+
+ Snow Data Graphic +
+
+
+
+
HISTORICAL SNOW DATA
+

Timberline has been recording snow depths since 1949. See how current measurements stack up to years past.

+

View Charts

+
+
+
+
+
+ + + + +
+
+ Close Modal Icon + +
+
+
+
We want to hear from you
+
Contact Us
+ +
+
+
+
+
+
+ +
+
+
+ + + +
+ + + + +
+ + + + + +
+ + + + +
+ + + + + +
+ + + + +
+ + + + + +
+ + + + +
+ + + +
+
+ + +

About Us

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

Timberline Lodge hotel rooms may be booked for one night. The Lodge at Government Camp Condos require a minimum of two nights.

+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ +
(12 & under)
+
+
+
+
+
+
+ +
+
Or contact us at: 1-800-547-1406
+
+
+
+
+
+
+
+ + Book a room + + + + + + + + + + + \ No newline at end of file diff --git a/test/resorts/timberline-lodge.js b/test/resorts/timberline-lodge.js new file mode 100644 index 00000000..3018629b --- /dev/null +++ b/test/resorts/timberline-lodge.js @@ -0,0 +1,21 @@ +const should = require('should'); +const { createReadStream } = require('fs'); +const parser = require('../../lib/lifts/parser'); +const parse = require('../../lib/lifts/parse')('timberline-lodge'); + +/*global describe, it */ +describe('parse timberline-lodge', function() { + + it('should return lift status', function(done) { + var stream = createReadStream(__dirname + '/example/timberline-lodge.html'); + stream.on('error', done); + stream.pipe(parser(parse, function(err, status) { + var expected = { + 'lift 1': 'open', + }; + should.exist(status); + status.should.eql(expected); + done(err); + })); + }); +});