<commit_before># wp-connect

### Wordpress connect module ###

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

## API

### WPCONN(<token>);

Create a new instance of WPCONN. If you wanna a way to get the access token
then can use [WPOAuth](https://github.com/cloudup/wp-oauth) npm module.

```js
var WPCONN = require('wp-connect');
var wpconn = WPCONN();
```

### WPCONN#me();

```js
var WPCONN = require('wp-connect');
var wpconn = new WPCONN('<your token>');

// get the user info
wpconn.me(function(err, user){
  // user info related with the given access token
});
```

### WPCONN#site.id(<id>);

Set site identifier

### WPCONN#site.info(params, fn);

Get the site information

```js
var WPCONN = require('wp-connect');
var wpconn = new WPCONN('<your token here>');

// get site info
wpconn.site.id('blog.wordpress.com');
wpconn.site.info(function(err, site){
  // site data object
});
```

### WPCONN#site.posts(params, fn);

Get the site posts

```js
wpconn.site.id('blog.wordpress.com');
wpconn.site.posts({ number: 10 }, function(err, posts){
  // posts array
});
```

### WPCONN.site.post.get(id, fn);

Get post site data

```js
// get post data
wpconn.site.post.get(435, params, function(err, post){
  // post data object
});
```

### WPCONN.site.post.getBySlug(slug, params, fn);

Get post site data by the given slug

```js
// get post data
wpconn.site.post.getBySlug('we-are-the-loosers', function(err, post){
  // post data object
});
```

### WPCONN.site.post.add(data, fn);

Add a new post

```js
// post data
var data = {
  "title": "A new post",
  "slug": "a-new-post",
  "content": "<div>The content of the new post</div>"
};

wpconn.site.post.add(data, function(err, new_post){
  // object data of the new post already added
});
```

### WPCONN.site.post.edit(id, data, fn);

Edit a post

```js
wpconn.site.post.edit(321, { title: "new Title !!!" }, function(err, edit_post){
  // the title in edit_post has changed
});
```
<commit_msg>doc: update module name. Clean.<commit_after># wpcom-connect

### Wordpress connect module ###

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

## API

### WPCONN(<token>);

Create a new instance of WPCONN. If you wanna a way to get the access token
then can use [WPOAuth](https://github.com/cloudup/wp-oauth) npm module.

```js
var WPCONN = require('wpcom-connect');
var wpconn = WPCONN();
```

### WPCONN#me.info();

```js
var WPCONN = require('wpcom-connect');
var wpconn = WPCONN('<your token>');

// get the user info
wpconn.me.info(function(err, user){
  // user info related with the given access token
});
```

### WPCONN#site.info(params, fn);

Get the site information

```js
var WPCONN = require('wpcom-connect');
var wpconn = WPCONN();

// get site info
wpconn.site.id('blog.wordpress.com');
wpconn.site.info(function(err, site){
  // site data object
});
```

## Methods complete list

| ----------------------------- |:----------------------------------:|
| WPCONN#me.info(params, fn)    | Meta data about auth token's User  |
| WPCONN#me.sites(params, fn)   | A list of the current user's sites |

{'fraction_non_alphanumeric': 0.19782945736434107, 'fraction_numerical': 0.00248062015503876, 'mean_word_length': 3.716374269005848, 'pattern_counts': {'":': 3, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5229013', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1141, 'n_words': 323}