TripFinder is a JavaScript tool for searching and retrieving car rides, stored in carpooling platform Tripda's database.
npm install https://github.com/tripda/tripfinder
bower install https://github.com/tripda/tripfinder
In order to use TripFinder you need to get a Google Places API Key. This key can be obtained for free, you only need a Google account.
var finder = require('tripfinder');
finder.setGeocoderKey('YOUR-KEY');
finder.setOrigin('Sao Paulo, SP, Brazil');
finder.setDestination('Rio de Janeiro, RJ, Brazil');
finder.find()
.then(function(trips) {
if (trips.length == 0) {
// No trips were found...
return;
}
console.log(trips.length + ' trips were found.');
trips.forEach(function(trip) {
var driver = trip.getDriver();
console.log('From: ' + trip.getOriginAddress());
console.log('To: ' + trip.getDestinationAddress());
console.log('Driver: ' + driver.getName());
console.log("\n");
});
});
(To do...)