ruboty-app_annie 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/ruboty/app_annie/actions/list_reviews.rb +19 -5
- data/lib/ruboty/app_annie/version.rb +1 -1
- data/lib/ruboty/app_annie.rb +3 -0
- data/lib/ruboty/handlers/app_annie.rb +10 -0
- 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: 258235bca361a0e59801fe949194c6241ca55211
|
4
|
+
data.tar.gz: 52c69bd1be6c2b004d1109da72af6596e533c2b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70c11d7a8732b300112b13e41dabe87fef14a22e44bf019aec36758bfe23122cf866b9a82d2e391819ae81a955a7a5b5348e994b4ec5354cdb21555568a53e65
|
7
|
+
data.tar.gz: dcdfc2705d4216c41cc4b2635b1d2259b74421724d990b83969d4b1811efb57ccf3f8fcfb96f07206e1b21e524253042ae70a1741c9d9144609fafe5fce6cf17
|
data/README.md
CHANGED
@@ -17,6 +17,7 @@ gem "ruboty-app_annie"
|
|
17
17
|
@ruboty annie list accounts - Retrieve all account connections available in an App Annie user account
|
18
18
|
@ruboty annie list products of <account_id> - Retrieve the product list of an Analytics Account Connection
|
19
19
|
@ruboty annie list {ios|android} reviews of <product_id> from <start_date> to <end_date> in <country> - Retrieve one product’s reviews
|
20
|
+
@ruboty annie list {ios|android} reviews of <product_id> days ago <days_ago> in <country> - Retrieve one product’s reviews of days ago
|
20
21
|
```
|
21
22
|
|
22
23
|
## ENV
|
@@ -3,17 +3,27 @@ module Ruboty
|
|
3
3
|
module Actions
|
4
4
|
class ListReviews < Base
|
5
5
|
def call
|
6
|
-
|
6
|
+
initialize_date_conditions
|
7
|
+
return if !exists_reviews?
|
8
|
+
|
9
|
+
list_reviews
|
7
10
|
end
|
8
11
|
|
9
12
|
private
|
10
13
|
|
14
|
+
def exists_reviews?
|
15
|
+
!reviews.empty?
|
16
|
+
end
|
17
|
+
|
11
18
|
def list_reviews
|
12
19
|
message.reply(reviews.join("\n\n"))
|
13
20
|
end
|
14
21
|
|
15
|
-
def
|
16
|
-
|
22
|
+
def initialize_date_conditions
|
23
|
+
days_ago = Date.today.ago(given_days_ago.to_i.days).to_date.to_s
|
24
|
+
@start_date = days_ago
|
25
|
+
@end_date = days_ago
|
26
|
+
rescue IndexError
|
17
27
|
end
|
18
28
|
|
19
29
|
def reviews
|
@@ -77,11 +87,15 @@ module Ruboty
|
|
77
87
|
end
|
78
88
|
|
79
89
|
def given_start_date
|
80
|
-
message[:start_date]
|
90
|
+
@start_date ||= message[:start_date]
|
81
91
|
end
|
82
92
|
|
83
93
|
def given_end_date
|
84
|
-
message[:end_date]
|
94
|
+
@end_date ||= message[:end_date]
|
95
|
+
end
|
96
|
+
|
97
|
+
def given_days_ago
|
98
|
+
message[:days_ago]
|
85
99
|
end
|
86
100
|
|
87
101
|
def given_country
|
data/lib/ruboty/app_annie.rb
CHANGED
@@ -21,6 +21,12 @@ module Ruboty
|
|
21
21
|
description: "Retrieve one product’s reviews",
|
22
22
|
)
|
23
23
|
|
24
|
+
on(
|
25
|
+
/annie list (?<market>ios|android) reviews of (?<product_id>.+) days ago (?<days_ago>.+) in (?<country>.+)\z/,
|
26
|
+
name: "list_reviews_of_days_ago",
|
27
|
+
description: "Retrieve one product’s reviews of days ago",
|
28
|
+
)
|
29
|
+
|
24
30
|
def list_accounts(message)
|
25
31
|
Ruboty::AppAnnie::Actions::ListAccounts.new(message).call
|
26
32
|
end
|
@@ -32,6 +38,10 @@ module Ruboty
|
|
32
38
|
def list_reviews(message)
|
33
39
|
Ruboty::AppAnnie::Actions::ListReviews.new(message).call
|
34
40
|
end
|
41
|
+
|
42
|
+
def list_reviews_of_days_ago(message)
|
43
|
+
Ruboty::AppAnnie::Actions::ListReviews.new(message).call
|
44
|
+
end
|
35
45
|
end
|
36
46
|
end
|
37
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-app_annie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fakestarbaby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruboty
|