Code Monkey home page Code Monkey logo

node-waze's Introduction

node-waze

fetch your commute data

Build Status
NPM

install

npm install waze

usage

var waze = require("waze");

var wazeLogin = {
  user_id: "myusername",
  password: "mypassword"
}

waze.createClient(wazeLogin, function(err, client) {
  
  client.trips.get(function(err, trips) {

    console.log("trip count: ", trips.length);

    var lastTrip = trips.shift();
    console.log("lastTrip: ", lastTrip);

    client.trip.get(lastTrip.id, function(err, trip){
      trip.forEach(function(segment){
        console.log("trip segment detail: ", segment);
      });  
    });

  });
});

test

npm test

example

node example/top-speed.js

outputs:

date       start    end      duration      name                                           meters kph 
2013-11-07 20:51:42 20:53:14 2 minutes     SR-90 W,Los Angeles                            2672   104 
2013-11-11 19:23:24 19:24:57 2 minutes     SR-90 W,Los Angeles                            2676   104 
2013-11-11 19:15:46 19:20:10 4 minutes     I-405 S,Los Angeles                            7618   104 
2013-11-07 20:51:03 20:51:18 a few seconds Exit 50B: Slauson Ave / Marina Fwy,Culver City 385    94  
2013-11-07 20:51:18 20:51:42 a few seconds to SR-90 W / Marina del Rey,Culver City        558    84  
2013-11-07 20:42:13 20:48:00 6 minutes     I-405 S,Los Angeles                            7958   83  
2013-11-05 17:19:05 17:19:10 a few seconds Sunset Blvd,West Hollywood                     116    79  
2013-11-11 19:22:55 19:23:24 a few seconds to SR-90 W / Marina del Rey,Culver City        564    71  
2013-11-11 19:21:17 19:22:34 a minute      I-405 S,Culver City                            1478   69 

Note: I'm using [node-replay][https://npmjs.org/package/replay] so you can run this script without needing your own account or drive data. To run it for yourself, edit the login info in top-speed.js. And either run with REPLAY=bloody node example/top-speed.js or comment the `require.

node-waze's People

Contributors

tphummel avatar

Watchers

James Cloos avatar Jeff Mealo avatar

Forkers

cagivajsp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.