<commit_before>chartbeat-php
=============
PHP library to interact with Chartbeat API.

See great [API docs](http://chartbeat.com/docs/api/) and [API explorer](http://chartbeat.com/docs/api/explore/) from [Chartbeat website](http://chartbeat.com) for more info.

This library requires PHP >5.3 and cURL extension for PHP to work. Tested with PHP 5.3.15 and 5.4.6

Please give feedback, report bugs, fork and contribute.

## Installation

Add chartbeat-php to your composer.json:

```php
{
	"require" : {
		"chartbeat/chartbeat-php" : "dev-master"
	}
}
```

Simple test script:

```php
require_once ('vendor/autoload.php'); // composer autoloader
$apiKey = '<your api key>';
$host = '<your host>';
$cb = new Chartbeat\Chartbeat($host, $apiKey);

// get monthly max people on site
echo 'Monthly max people on the site: ' . $cb->getMonthlyMaxPeople(); 
```

You can also do any kind of API query using get() method. First parameter is data endpoint (eg. 'historical/traffic/series'), seconds one contains parameters.
<commit_msg>Recommended version for composer.json is now 1.*<commit_after>chartbeat-php
=============
PHP library to interact with Chartbeat API.

See great [API docs](http://chartbeat.com/docs/api/) and [API explorer](http://chartbeat.com/docs/api/explore/) from [Chartbeat website](http://chartbeat.com) for more info.

This library requires PHP >5.3 and cURL extension for PHP to work. Tested with PHP 5.3.15 and 5.4.6

Please give feedback, report bugs, fork and contribute.

## Installation

Add chartbeat-php to your composer.json:

```php
{
	"require" : {
		"chartbeat/chartbeat-php" : "1.*"
	}
}
```

Simple test script:

```php
require_once ('vendor/autoload.php'); // composer autoloader
$apiKey = '<your api key>';
$host = '<your host>';
$cb = new Chartbeat\Chartbeat($host, $apiKey);

// get monthly max people on site
echo 'Monthly max people on the site: ' . $cb->getMonthlyMaxPeople(); 
```

You can also do any kind of API query using get() method. First parameter is data endpoint (eg. 'historical/traffic/series'), seconds one contains parameters.

{'fraction_non_alphanumeric': 0.1451923076923077, 'fraction_numerical': 0.009615384615384616, 'mean_word_length': 4.349614395886889, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '1707834', 'n_tokens_mistral': 672, 'n_tokens_neox': 645, 'n_words': 232}