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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a42ad2a0f6b525d3949ea17bd03293dcb77c6210
4
- data.tar.gz: a1d774b69f5805ca072fac499aae783a2ecb8b9d
3
+ metadata.gz: edc0c2543c456835f55f1db27b1856b997958d9b
4
+ data.tar.gz: af28af4e278a6d3977fc9490fb69c232cab15444
5
5
  SHA512:
6
- metadata.gz: aa5cc6dc3350ffcfa32d240e91bc301f218882c1eee33c954264f5151084e13a3aaa68e6f6080db4fabf5c9aeaa266014e3d33489f0f7a414ca5619e47b76a23
7
- data.tar.gz: ba3314bd668fb12b4b19a1391c8eb0a307cf282af2f1555cd7fb5879b8c42c6c4b423ea780b4ed964d52ae8393610f500364120089e4ca756996a5bdeb60f560
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.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