intercom_summary 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/intercom_summary/version.rb +1 -1
- data/lib/intercom_summary.rb +3 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f00041eab8c264f359ed6432556284b98ada08cb
|
4
|
+
data.tar.gz: 2f1555f64b9991db0e5e84a6d0043c2191f9aa6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc159dc749c8b725595becb3c76cca9e21add7c339a8ac9305dafb3370ab29dc3ccaa7e54fcaea5c4922e38acfa95a18ae5e2a6a884da67f60bb1ae266032dfe
|
7
|
+
data.tar.gz: 7c02e3b42fb501865551be0fcf0818431382b99738ae789ff2c3b40039070113d296fa75b5163d3248ba55ecedeeb52631e3f42d5ac6bdac5821a5158beb8acb
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# IntercomSummary
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/intercom_summary.svg)](https://badge.fury.io/rb/intercom_summary)
|
4
|
+
[![Dependency Status](https://gemnasium.com/badges/github.com/unhappychoice/intercom_summary.svg)](https://gemnasium.com/github.com/unhappychoice/intercom_summary)
|
5
|
+
![](http://ruby-gem-downloads-badge.herokuapp.com/intercom_summary?type=total)
|
6
|
+
|
3
7
|
## Installation
|
4
8
|
|
5
9
|
```ruby
|
data/lib/intercom_summary.rb
CHANGED
@@ -9,7 +9,6 @@ module IntercomSummary
|
|
9
9
|
def self.start
|
10
10
|
users = []
|
11
11
|
|
12
|
-
puts 'Loading users from intercom...'
|
13
12
|
intercom = Intercom::Client.new(app_id: ENV['INTERCOM_APP_ID'], api_key: ENV['INTERCOM_APP_KEY'])
|
14
13
|
intercom.users.scroll.each { |user| users.push user }
|
15
14
|
|
@@ -17,14 +16,9 @@ module IntercomSummary
|
|
17
16
|
weekly_active_users = users.select { |user| user.last_request_at.to_i + SECONDS_OF_DAY * 7 > Time.now.to_i }
|
18
17
|
daily_active_users = users.select { |user| user.last_request_at.to_i + SECONDS_OF_DAY * 1 > Time.now.to_i }
|
19
18
|
|
20
|
-
puts
|
21
|
-
puts
|
22
|
-
puts
|
23
|
-
puts "monthly: #{monthly_active_users.size}"
|
24
|
-
puts "weekly: #{weekly_active_users.size}"
|
25
|
-
puts "daily: #{daily_active_users.size}"
|
26
|
-
|
27
|
-
puts ''
|
19
|
+
puts "Monthly Active Users: #{monthly_active_users.size}"
|
20
|
+
puts "Weekly Active Users: #{weekly_active_users.size}"
|
21
|
+
puts "Daily Active Users: #{daily_active_users.size}"
|
28
22
|
end
|
29
23
|
end
|
30
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom_summary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- unhappychoice
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: intercom
|