scoutmetrics 0.0.0 → 0.0.1
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 +4 -4
- data/README.md +46 -0
- data/scoutmetrics.gemspec +33 -0
- data/vendor/assets/javascripts/scoutmetrics.js +45 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc0c2543c456835f55f1db27b1856b997958d9b
|
4
|
+
data.tar.gz: af28af4e278a6d3977fc9490fb69c232cab15444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a0f2ee33e9d8785b2e5a04f959310a54c20682c9f744f7756412f262062bb91645638f3e6fb7baafae37742cdc7ce134ad582718ebf31eec34037a2370ed13d
|
7
|
+
data.tar.gz: ac56ec549ae382b44251cd17ffbadb77594db17fe3992b19fa56e9f85303422fe385eecf4d065a27822b653e18e649d63c61b202a474b02b7363f0ffd6513ff4
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
The Scout Metrics Ruby Gem
|
2
|
+
====================
|
3
|
+
A Ruby wrapper for the Scout Metrics
|
4
|
+
|
5
|
+
Overview
|
6
|
+
------------
|
7
|
+
Scout Metrics is an application that tracks engagement on your website, as well as culminates data from the following sources into actionable statistics: Facebook, Twitter, Instagram, and Google Analytics.
|
8
|
+
|
9
|
+
This gem is used to help users of Scout Metrics give us data when their users engage in an action (such as commenting on a post, if you're hosting a blog), or when a new user signs up for their service.
|
10
|
+
|
11
|
+
Installation
|
12
|
+
------------
|
13
|
+
gem install scoutmetrics
|
14
|
+
|
15
|
+
Or include it in your application,
|
16
|
+
gem 'scoutmetrics', '~> 0.0.0'
|
17
|
+
|
18
|
+
Usage
|
19
|
+
------------
|
20
|
+
|
21
|
+
When you sign up on Scout Metrics your site will be assigned a token, configure this gem to use that token as follows
|
22
|
+
```ruby
|
23
|
+
ScoutMetrics.configure do |config|
|
24
|
+
config.access_token = MY_ACCESS_TOKEN
|
25
|
+
end```
|
26
|
+
|
27
|
+
### User API (found in `/lib/scoutmetrics/user.rb`)
|
28
|
+
To tell us a user has signed up
|
29
|
+
`ScoutMetrics::User.create(user.id)`
|
30
|
+
|
31
|
+
Or if you wanted to backfill signups
|
32
|
+
```ruby
|
33
|
+
User.each do |user|
|
34
|
+
ScoutMetrics::User.create(user.id, user.created_at)
|
35
|
+
end```
|
36
|
+
|
37
|
+
To tell us about their latest login (so we can track retention for you)
|
38
|
+
`ScoutMetrics::User.update(user.id)`
|
39
|
+
|
40
|
+
### Engagement API (found in `/lib/scoutmetrics/engagement.rb`)
|
41
|
+
Tell us that one of your users commented on a post
|
42
|
+
`ScoutMetrics::Engagement.create("Commented on Post")`
|
43
|
+
|
44
|
+
Developers
|
45
|
+
------------------------------
|
46
|
+
This gem is developed by Must Win, LLC [http://mustwin.com]
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#require File.expand_path('../lib/instagram/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'scoutmetrics'
|
6
|
+
s.version = '0.0.1'
|
7
|
+
s.date = '2014-10-20'
|
8
|
+
s.summary = 'Ruby wrapper for the Scout Metrics API'
|
9
|
+
s.description = 'Ruby wrapper for the Scout Metrics API'
|
10
|
+
s.authors = ['Dosty Everts']
|
11
|
+
s.email = 'dosty@mustwin.com'
|
12
|
+
#s.files = %w(lib/scoutmetrics.rb lib/scoutmetrics/configuration.rb lib/scoutmetrics/engagement.rb lib/scoutmetrics/request.rb lib/scoutmetrics/user.rb)
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
|
+
s.homepage = 'https://github.com/MustWin/scoutmetrics-ruby-gem'
|
15
|
+
s.license = 'MIT'
|
16
|
+
#s.add_development_dependency('rake', '~> 0.9.2.2')
|
17
|
+
s.add_dependency 'http', '~> 0.6.0'
|
18
|
+
s.add_dependency 'http_parser.rb', '~> 0.6.0'
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
#s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
+
#s.files = `git ls-files`.split("\n")
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
#s.platform = Gem::Platform::RUBY
|
28
|
+
#s.require_paths = ['lib']
|
29
|
+
#s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
|
30
|
+
#s.rubyforge_project = s.name
|
31
|
+
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
;(function ($, window, document, undefined ) {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var ScoutMetrics = {
|
5
|
+
accessToken: '6qPPlrlPYk5erffdy7cgig'
|
6
|
+
Request: {
|
7
|
+
init: function() {
|
8
|
+
this.domain = 'https://scoutmetrics.com/api/v1'
|
9
|
+
},
|
10
|
+
send: function(method, route, data) {
|
11
|
+
var self = this;
|
12
|
+
data['token'] = ScoutMetrics.accessToken;
|
13
|
+
$.ajax({
|
14
|
+
url: self.domain + route,
|
15
|
+
type: method,
|
16
|
+
data: data
|
17
|
+
});
|
18
|
+
}
|
19
|
+
},
|
20
|
+
User: {
|
21
|
+
create: function(params) {
|
22
|
+
params['signup_date'] || (params['signup_date'] = new Date());
|
23
|
+
Request.send('POST', '/app_users', { app_user: params });
|
24
|
+
},
|
25
|
+
update: function(params) {
|
26
|
+
params['return_date'] || (params['return_date'] = new Date());
|
27
|
+
Request.send('POST', '/app_users', { app_user: params });
|
28
|
+
}
|
29
|
+
},
|
30
|
+
Engagement: {
|
31
|
+
create: function(params) {
|
32
|
+
Request.send('POST', '/engagements', { engagement: params });
|
33
|
+
},
|
34
|
+
report: function(engagement_params, date_recorded) {
|
35
|
+
date_recorded || (date_recorded = new Date());
|
36
|
+
params = { engagement: engagement_params,
|
37
|
+
engagement_instance: { date_recorded: date_recorded } };
|
38
|
+
Request.send('POST', '/engagements/add_instance', params);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
window.ScoutMetrics = ScoutMetrics;
|
44
|
+
|
45
|
+
})(jQuery,window,document);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scoutmetrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dosty Everts
|
@@ -44,11 +44,14 @@ executables: []
|
|
44
44
|
extensions: []
|
45
45
|
extra_rdoc_files: []
|
46
46
|
files:
|
47
|
+
- README.md
|
47
48
|
- lib/scoutmetrics.rb
|
48
49
|
- lib/scoutmetrics/configuration.rb
|
49
50
|
- lib/scoutmetrics/engagement.rb
|
50
51
|
- lib/scoutmetrics/request.rb
|
51
52
|
- lib/scoutmetrics/user.rb
|
53
|
+
- scoutmetrics.gemspec
|
54
|
+
- vendor/assets/javascripts/scoutmetrics.js
|
52
55
|
homepage: https://github.com/MustWin/scoutmetrics-ruby-gem
|
53
56
|
licenses:
|
54
57
|
- MIT
|