0.01
No commit activity in last 3 years
No release in over 3 years
A ruby wrapper for Kahuna Push API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

~> 0.9.1
>= 0
>= 1.10.0
 Project Readme

KahunaClient Build Status Gem Version

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: "awesome@mail.com",
      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, it supports the following adapters:

Beside the adapter, you can change the following properties:

  • endpoint
  • user_agent
  • proxy
  • debug
  • environment

For instance:

require 'typhoeus/adapters/faraday' # You will need the typhoeus gem

client = KahunaClient.client(adapter: :typhoeus, user_agent: "foobar v1", debug: true, secret_key: 'foo', api_key: 'bar')
client.push(push_array)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request