rescuetime.js

0.0.3 • Public • Published

rescuetime.js Build Status

An API client for rescuetime.com

Note: This is in super alpha and really hasn't been tested or used. Feedback and PR's welcome!

Install

npm install rescuetime.js

Usage

You can make calls to the api like so:

Note: I suggest you use dotenv to store your API key since you definitely do not want that in version control.

 
   var Rescuetime = require('rescuetime.js').create('YOUR_API_KEY')
 
   var parameters = {
        pv: 'rank',
        rk: 'productivity'
    }
 
    Rescuetime.request('GET', 'anapi/data', parameters, function(err,response) {
         console.log(res)
    })
 

You can also use promises if that's your squeeze

 
   var parameters = {
        pv: 'rank',
        rk: 'productivity'
    }
 
    Rescuetime.request('GET', 'anapi/data', parameters)
    .then(function(response) { console.log(response} )
 

The plan is to also add some helpful methods that cut to the chase.

 
    Rescuetime.totalProductiveTimeInSeconds()
    .then(function(res) { console.log(res) })
 

Package Sidebar

Install

npm i rescuetime.js

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • willwashburn