1.1.4 • Published 7 years ago

freerider v1.1.4

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

freerider

Introduction

A library for for fetching and searching available cars on Hertz Freerider. Includes a module to notify about matches with a Slack Hook.

What is Hertz Freerider?

Hertz Freerider is a service that enables you to drive cars that needs to be moved for free. Find out more here: https://www.hertzfreerider.se/

How to use

let Freerider = require('freerider');

let routes = [
	new Freerider.Route('göteborg', '*'),
];

// a notifier can be anything with a send-method that gets a formatted string
let notifier = {
	send: function(message){console.log(message)}
}

// When called in a static context, data is fetched and searched directly
Freerider.Helper.search(routes, notifier);	

// When using an instance, fetched data can be saved and reused
let helper = new Freerider.Helper();
helper.getTrips(function(trips){
	// available trips are now saved in the instance, multiple searches with different routes and notifiers can be made without fetching data again
	helper.search(routes, notifier);
	// if you need to clear trips
	helper.clearTrips();
})
1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago