<commit_before># KahunaClient [![Build Status](https://travis-ci.org/edgar/KahunaClient.png?branch=master)](https://travis-ci.org/edgar/KahunaClient)
A ruby gem for the Kahuna Push API - https://app.usekahuna.com/tap/getstarted/pushapi/

## Installation

Add this line to your application's Gemfile:

    gem 'kahuna_client'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install kahuna_client


## API Usage Examples

    require "rubygems"
    require "kahuna_client"

    client = KahunaClient::Client.new(secret_key: 'your secret key', api_key: 'your api key')

    push_object = {
      target: {
          username: "iamawesome1989",
          email: "<EMAIL>",
          fbid: "42",
          user_id: "789"
      },
      notification: {
          alert: "Look at this Push!"
      },
      params: {
          sale_id: "1234",
          landing_page: "share_page"
      },
      config: {
          start_time: 1382652322,
          optimal_hours: 8,
          influence_rate_limiting: true,
          observe_rate_limiting: true
      }
    }

    # Send the pushes (one or more)
    client.push([push_object])


For more information about extra parameters and error conditions check the specs folder

## Configuration

Because KahunaClient gem is based on [Faraday](https://github.com/lostisland/faraday), it supports the following adapters:

* Net::HTTP (default)
* [Excon](https://github.com/geemus/excon)
* [Typhoeus](https://github.com/typhoeus/typhoeus)
* [Patron](http://toland.github.com/patron/)<commit_msg>Update README with ruby syntax<commit_after># KahunaClient [![Build Status](https://travis-ci.org/edgar/KahunaClient.png?branch=master)](https://travis-ci.org/edgar/KahunaClient)
A ruby gem for the Kahuna Push API - https://app.usekahuna.com/tap/getstarted/pushapi/

## Installation

Add this line to your application's Gemfile:

    gem 'kahuna_client'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install kahuna_client


## API Usage Examples

```ruby
    require "rubygems"
    require "kahuna_client"

    client = KahunaClient::Client.new(secret_key: 'your secret key', api_key: 'your api key')

    push_object = {
      target: {
          username: "iamawesome1989",
          email: "<EMAIL>",
          fbid: "42",
          user_id: "789"
      },
      notification: {
          alert: "Look at this Push!"
      },
      params: {
          sale_id: "1234",
          landing_page: "share_page"
      },
      config: {
          start_time: 1382652322,
          optimal_hours: 8,
          influence_rate_limiting: true,
          observe_rate_limiting: true
      }
    }

    # Send the pushes (one or more)
    client.push([push_object])
```

For more information about extra parameters and error conditions check the specs folder

## Configuration

Because KahunaClient gem is based on [Faraday](https://github.com/lostisland/faraday), it supports the following adapters:

* Net::HTTP (default)
* [Excon](https://github.com/geemus/excon)
* [Typhoeus](https://github.com/typhoeus/typhoeus)
* [Patron](http://toland.github.com/patron/)
{'fraction_non_alphanumeric': 0.11884984025559106, 'fraction_numerical': 0.015335463258785943, 'mean_word_length': 2.865432098765432, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 12, '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': '6448967', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1001, 'n_words': 242}