hess-get-profile-values

Extract all profile values that exist for a given customer login on the https://hessenergy.com website

npm install hess-get-profile-values
4 downloads in the last week
8 downloads in the last month

Get Profile Values

On the https://hessenergy.com website, there can be several profile values for a given customer login. These appear in the upper-left hand corner of the page under the Select Profile dropdown.

For some customer logins, there will only be a default profile and no dropdown will appear. In this case the module returns null

Installation

npm install -S hess-get-profile-values-for-login

Usage

var getProfileValuesForLogin = require('hess-get-profile-values-for-login')
var currentLogin = {
  username: 'fooUsername',
  password: 'barPassword'
}
getProfileValuesForLogin(currentLogin, function (err, reply) {
  if (err) {
    inspect(err, 'error getting profile values for login')
    return
  }
  var values = reply.values
  var jar = reply.jar
  inspect(jar, 'authenticated cookie jar')
  inspect(values, 'profile values')
})
npm loves you