old_contents: var domutil = require('./domutil');
  var decode = require('./entities');
  var debug = require('debug')('liftie:resort:vail');
  
  module.exports = parse;
  
  function getStatus(tr) {
    var node = domutil.child(tr, '2/0');
    if (node && node.attribs && node.attribs.alt) {
      return node.attribs.alt;
    }
    node = domutil.child(tr, 2);
    if (node && node.attribs && node.attribs.class) {
      return node.attribs.class.slice(0, -6);
    }
  }
  
  
  // common parser for Vail Resorts lift status
  function parse(dom) {
    var liftStatus = domutil.collect(dom, '#Lifts tr', function(tr, index) {
      var name, status;
  
      if (index === 0) {
        return; // skip header
      }
  
      status = getStatus(tr);
      if (!status) {
        return;
      }
      name = decode(domutil.childText(tr, '0/0')).trim();
      if (/ Express Lift$/.test(name)) {
        name = name.slice(0, - ' Express Lift'.length);
      }
  
      return {
        name: name,
        status: status
      };
    });
  
    debug('vail Lift Status:', liftStatus);
    return liftStatus;
  }
new_contents: var safeEval = require('safe-eval');
  var debug = require('debug')('liftie:resort:vail');
  
  var domutil = require('./domutil');
  var select = require('../select');
  
  module.exports = parse;
  
  
  
  var statuses = ['closed', 'open', 'hold'];
  
  function extractLiftData(script) {
    function evalHelper(_, fn) {
      var data = {};
      fn(data);
      return data;
    }
  
    var data = safeEval(script, { require: evalHelper });
    return data && data.TerrainStatusFeed && data.TerrainStatusFeed.Lifts || [];
  }
  
  
  // common parser for Vail Resorts lift status
  function parse(dom) {
    var dataScript = select(dom, 'script')
      .map(function(script) {
        return domutil.allText(script).trim();
      })
      .filter(function(script) {
        return script.startsWith('require');
      })[0];
  
  
    var liftStatus = extractLiftData(dataScript)
      .reduce(function(liftStatus, lift) {
        liftStatus[lift.Name.trim()] = statuses[lift.Status];
        return liftStatus;
      }, {});
  
    debug('vail Lift Status:', liftStatus);
    return liftStatus;
  }
  
subject: update vail resort lift parsing