botmetrics-rb 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bfdb6f2c5185bfc55b0e3d513f5373543c46c96
4
- data.tar.gz: 3e0bba776347f42429dabdb50299f0b0d0f0c691
3
+ metadata.gz: 98ba5b37417b450981dc1c20cbc1fce08f94bae2
4
+ data.tar.gz: c0d606e3e92f79f473be28a3bbeda0b7f83787d7
5
5
  SHA512:
6
- metadata.gz: acca01aad2a3fe7384cea188e4c696700759903e57e9346d0fea31cd98c304e10477c999f880543eccd0632b86528ecb04918aece220b40fc734bc89baf270cb
7
- data.tar.gz: 60d7b9f43b5c980b7feb29ef599361388bd04ba8186b4cfca0ef6c4b4c8a26c28cde8290722c5810b1f13ae75d4ef965883a53c62d33b82544143de7ffe48211
6
+ metadata.gz: 9b9c84184f3c351748482bebe7d01d236db4320f3d873bb4c6f247f5c78ae314d2052311262ed6a1dbdd36ba8b93f3719319f56a110dd4e65a7c427fd238911e
7
+ data.tar.gz: 46286a5e0b11525edcb5c6be9e524fd61674ac789debdaffbc26d31d7b09ebd1a1763cba38842671db11bfd1621668c29e73880804278d81d3524c85162da044
data/README.md CHANGED
@@ -12,7 +12,7 @@ Status](https://travis-ci.org/botmetrics/botmetrics-rb.svg?branch=master)](https
12
12
  Add this line to your application's Gemfile:
13
13
 
14
14
  ```ruby
15
- gem 'botmetrics-rb'
15
+ gem 'botmetrics-rb', require: 'botmetrics'
16
16
  ```
17
17
 
18
18
  And then execute:
@@ -23,10 +23,40 @@ Or install it yourself as:
23
23
 
24
24
  $ gem install botmetrics-rb
25
25
 
26
- ## Usage
26
+ ## Usage (Facebook)
27
27
 
28
- Log in to your [BotMetrics](https://getbotmetrics.com) account, navigate
29
- to "Bot Settings" and find out your Bot ID and API Key.
28
+ Register your Facebook bot with
29
+ [Botmetrics](https://getbotmetrics.com). Once you have done so, navigate to "Bot Settings" and find out your Bot ID and API Key.
30
+
31
+ With that, you can initialize a `BotMetrics::Client`:
32
+
33
+ ```ruby
34
+ client = BotMetrics::Client.new(api_key: '123', bot_id: '123')
35
+ ```
36
+
37
+ Alternatively, you can set the following ENV variables
38
+
39
+ - `ENV['BOTMETRICS_API_KEY']`
40
+ - `ENV['BOTMETRICS_BOT_ID']`
41
+
42
+ and initialize a `BotMetrics::Client` with the default ENV variables:
43
+
44
+ ```ruby
45
+ client = BotMetrics::Client.new
46
+ ```
47
+
48
+ ### track
49
+
50
+ Call the `track` API in the webhook receiver that handles all of your
51
+ Facebook messages.
52
+
53
+ ```ruby
54
+ client.track(params)
55
+ ```
56
+
57
+ ## Usage (Slack)
58
+
59
+ Log in to your [BotMetrics](https://getbotmetrics.com) account, navigate to "Bot Settings" and find out your Bot ID and API Key.
30
60
 
31
61
  With that, you can initialize a `BotMetrics::Client`:
32
62
 
@@ -38,7 +68,6 @@ Alternatively, you can set the following ENV variables
38
68
 
39
69
  - `ENV['BOTMETRICS_API_KEY']`
40
70
  - `ENV['BOTMETRICS_BOT_ID']`
41
- - `ENV['BOTMETRICS_API_HOST']`
42
71
 
43
72
  and initialize a `BotMetrics::Client` with the default ENV variables:
44
73
 
@@ -1,3 +1,3 @@
1
1
  module BotMetrics
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -48,7 +48,7 @@ module BotMetrics
48
48
  raise ArgumentError.new("event is not a valid JSON string or Hash")
49
49
  end
50
50
 
51
- response = HTTP.auth(api_key).post("#{api_url}/events", params: {event: event_json})
51
+ response = HTTP.auth(api_key).post("#{api_url}/events", params: {event: event_json, format: 'json'})
52
52
  response.code == 202
53
53
  end
54
54
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: botmetrics-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - arunthampi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json