<commit_before># node-up

A node.js API wrapper for the undocumented Jawbone UP API.

Based on Eric Blue's most-excellent work, found here: http://eric-blue.com/projects/up-api/

![TravisCI Build Status](https://travis-ci.org/jonlong/node-up.png)

##Note
This is not an API that is officially supported by Jawbone and shouldn't be considered for use in production applications. Please use this client at your own risk, and please be considerate when making requests!

##Usage
###Setup
```js
var Up = require('node-up');

var upClient = new Up({
  username: JAWBONE_USERNAME,
  password: <PASSWORD>
});
```

###Authenticating
The UP API requires that an auth token is passed with each request.  To generate the token, call the `auth` method.

```js
upClient.auth(function(err, res){
  var token = res.token;
  console.log(token);
});
```
It's a good idea to make the auth request first and store the resulting token in your app for subsequent requests.

###Calling the Endpoints
The only required parameter for each endpoint is the token.

```js
upClient.feedSummary({_token: token}, function(err, res) {
	console.log(res);
});
```

Some endpoints accept further parameters, which are documented before each method in `/lib/Up.js`, as well as in [Eric's API docs](http://eric-blue.com/projects/up-api/).

##Installation
```
npm install node-up
```

##Run Tests
``` bash
  $ npm test
```
<commit_msg>Adding a note about token expiration<commit_after># node-up

A node.js API wrapper for the undocumented Jawbone UP API.

Based on Eric Blue's most-excellent work, found here: http://eric-blue.com/projects/up-api/

![TravisCI Build Status](https://travis-ci.org/jonlong/node-up.png)

##Note
This is not an API that is officially supported by Jawbone and shouldn't be considered for use in production applications. Please use this client at your own risk, and please be considerate when making requests!

##Usage
###Setup
```js
var Up = require('node-up');

var upClient = new Up({
  username: JAWBONE_USERNAME,
  password: <PASSWORD>
});
```

###Authenticating
The UP API requires that an auth token is passed with each request.  To generate the token, call the `auth` method.

```js
upClient.auth(function(err, res){
  var token = res.token;
  console.log(token);
});
```
It's a good idea to make the auth request first and store the resulting token in your app for subsequent requests.  With that said, I'm not sure if this token expires at some point, so you should be aware of that possibility.

###Calling the Endpoints
The only required parameter for each endpoint is the token.

```js
upClient.feedSummary({_token: token}, function(err, res) {
	console.log(res);
});
```

Some endpoints accept further parameters, which are documented before each method in `/lib/Up.js`, as well as in [Eric's API docs](http://eric-blue.com/projects/up-api/).

##Installation
```
npm install node-up
```

##Run Tests
``` bash
  $ npm test
```

{'fraction_non_alphanumeric': 0.11604095563139932, 'fraction_numerical': 0.0, 'mean_word_length': 4.417744916820703, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5667400', 'n_tokens_mistral': 916, 'n_tokens_neox': 865, 'n_words': 370}