<commit_before># node-wpcom

### WordPress API for nodejs

  Nodejs module to get resources from [WordPress](http://www.wordpress.com) using the [developer.wordpress.com/docs/api/](REST API).

## How to use it

```js
// create a WPCOM instance
var wpcom = require('wpcom')('<your-token>');

// create a blog hanlder instance
var blog = wpcom.site('blog.wordpress.com');

// get blog posts
blog.posts({ number: 8 }, function(err, list){
  // posts list object
});
```

## API

### WPCOM('token');

Create a new instance of WPCOM. `token` parameter is optional but it's needed to
make admin actions or to access to protected resources.

Note: If you wanna a way to get the access token can use [node-wpcom-oauth](https://github.com/Automattic/node-wpcom-oauth) npm module.

### WPCOM#me()

Create a `Me` object. More info in [Me doc page](./doc/me.md).

### WPCOM#site('site-id')

Create a `Site` object. More info in [Site doc page](./doc/site.md).

## Example

Into `example/` folder download the npm dependencies:

```cli
$ npm install
```

... and then run the application<commit_msg>doc: add exaples to .me() and .posts() methods<commit_after># node-wpcom

### WordPress API for nodejs

  Nodejs module to get resources from [WordPress](http://www.wordpress.com) using the [developer.wordpress.com/docs/api/](REST API).

## How to use it

```js
// create a WPCOM instance
var wpcom = require('wpcom')('<your-token>');

// create a blog hanlder instance
var blog = wpcom.site('blog.wordpress.com');

// get blog posts
blog.posts({ number: 8 }, function(err, list){
  // posts list object
});
```

## API

### WPCOM('token');

Create a new instance of WPCOM. `token` parameter is optional but it's needed to
make admin actions or to access to protected resources.

Note: If you wanna a way to get the access token can use [node-wpcom-oauth](https://github.com/Automattic/node-wpcom-oauth) npm module.

### WPCOM#me()

Create a `Me` object. More info in [Me doc page](./doc/me.md).

```js
var wpcom = require('wpcom')('<your-token>');
var me = wpcom.me();

// get user information
me.get(function(err, info){
});

```
## Example

### WPCOM#site('site-id')

Create a `Site` object. More info in [Site doc page](./doc/site.md).

```js
var wpcom = require('wpcom')('<your-token>');
var site = wpcom.site();

// get blog posts
site.posts(function(err, list){

});

```
## Example

Into `example/` folder download the npm dependencies:

```cli
$ npm install
```

... and then run the application
{'fraction_non_alphanumeric': 0.1634538152610442, 'fraction_numerical': 0.0008032128514056225, 'mean_word_length': 3.962151394422311, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6901449', 'n_tokens_mistral': 838, 'n_tokens_neox': 809, 'n_words': 287}