hess-login

Login to the Hess Energy website using node.js and the request module

npm install hess-login
4 downloads in the last month

Hess Energy Login

A module to login to the Hess Energy website using request. Upon successful login, a request cookie jar object is returned which can be used in subsequent requests

Installation

npm install -S git+ssh://git@bitbucket.org:competitiveenergy/hess-login.git

Usage

Call with an object that has username and password fields set. If the login is successful the second parameter of the callback will be the path to the authenticated cookie file on disk that can be used in subsequent requests

var hesLogin = require('hess-login')
// currentLogin is a customer login for the https://www.hessenergy.com/dashboard/unauthenticated.aspx website
var currentLogin = {
  username: 'fooUsername@gmail.com',
  password: 'barPassword'
}
hesLogin(currentLogin, function (err, jar) {
  if (err) {
    console.dir('error logging into hess energy website', err)
  }
  console.dir('logged into Hess Energy website correctly, current cookie jar', jar)
})

Tests

# install the development dependencies
npm install
# run the tests
npm test
npm loves you