madmimi 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -0
- data/Rakefile +7 -0
- data/VERSION +1 -1
- data/config/paths.yml +25 -23
- data/lib/madmimi.rb +13 -2
- data/madmimi.gemspec +5 -3
- data/spec/cassettes/list_size/list_exists.yml +46 -0
- data/spec/cassettes/list_size_since/list_members.yml +46 -0
- data/spec/madmimi_spec.rb +21 -0
- data/spec/spec_helper.rb +0 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aee62825b032cd78b82b09ab0ac0f1c83848cbf
|
4
|
+
data.tar.gz: 1c340035d5e013775f4d181141f174a1c86964b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75535a7e2ef71ddb00a7b20a83384d81b41e6f57a242dd7a2502cbb0f4298e14dd5a04646ad34e7ff2f0fd0964c089989659e0af347b80920279aace008d2cbb
|
7
|
+
data.tar.gz: 70155098cdc2fe413f05545612f05cf9c15e7150bf49339134c71a7c82aba54194bcd192bf8221ee052cd521aa4da00acb412cef67208d0648539d5f970b1302
|
data/README.rdoc
CHANGED
@@ -62,6 +62,8 @@ You can set +verify_ssl+ to either true or false in initializer, if you wish ver
|
|
62
62
|
|
63
63
|
mimi.list_members('Test List') # get audience members in specific list
|
64
64
|
|
65
|
+
mimi.list_members('Test List', 2, 50) # get audience members on the 2nd page in specific list (50 members per page)
|
66
|
+
|
65
67
|
mimi.suppressed?('dave@example.com') # check if audience member is suppressed
|
66
68
|
|
67
69
|
mimi.suppress_email('dave@example.com') # move email to suppressed list
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/config/paths.yml
CHANGED
@@ -1,23 +1,25 @@
|
|
1
|
-
:create_list:
|
2
|
-
:remove_from_all_lists:
|
3
|
-
:destroy_list:
|
4
|
-
:add_to_list:
|
5
|
-
:remove_from_list:
|
6
|
-
:audience_lists:
|
7
|
-
:audience_list_members:
|
8
|
-
:audience_members:
|
9
|
-
:get_audience_members:
|
10
|
-
:search:
|
11
|
-
:memberships:
|
12
|
-
:is_suppressed:
|
13
|
-
:update_user_email:
|
14
|
-
:suppressed_since:
|
15
|
-
:suppress_user:
|
16
|
-
:unsuppress_user:
|
17
|
-
:promotions:
|
18
|
-
:promotion_save:
|
19
|
-
:mailing_stats:
|
20
|
-
:mailer:
|
21
|
-
:mailer_to_list:
|
22
|
-
:mailer_to_all:
|
23
|
-
:mailer_status:
|
1
|
+
:create_list: /audience_lists.json
|
2
|
+
:remove_from_all_lists: /audience_lists/remove_all
|
3
|
+
:destroy_list: /audience_lists/%{list}
|
4
|
+
:add_to_list: /audience_lists/%{list}/add
|
5
|
+
:remove_from_list: /audience_lists/%{list}/remove
|
6
|
+
:audience_lists: /audience_lists/lists.xml
|
7
|
+
:audience_list_members: /audience_lists/%{list}/members.xml
|
8
|
+
:audience_members: /audience_members
|
9
|
+
:get_audience_members: /audience_members.xml
|
10
|
+
:search: /audience_members/search.xml
|
11
|
+
:memberships: /audience_members/%{email}/lists.xml
|
12
|
+
:is_suppressed: /audience_members/%{email}/is_suppressed
|
13
|
+
:update_user_email: /audience_members/%{email}/update_email
|
14
|
+
:suppressed_since: /audience_members/suppressed_since/%{timestamp}.txt
|
15
|
+
:suppress_user: /suppressed_audience_members
|
16
|
+
:unsuppress_user: /suppressed_audience_members/%{email}
|
17
|
+
:promotions: /promotions.xml
|
18
|
+
:promotion_save: /promotions/save
|
19
|
+
:mailing_stats: /promotions/%{promotion_id}/mailings/%{mailing_id}.xml
|
20
|
+
:mailer: /mailer
|
21
|
+
:mailer_to_list: /mailer/to_list
|
22
|
+
:mailer_to_all: /mailer/to_all
|
23
|
+
:mailer_status: /mailers/status/%{transaction_id}
|
24
|
+
:audience_list_size: /audience_lists/%{list}/list_size
|
25
|
+
:audience_list_size_since: /audience_lists/%{list}/list_size_since/%{date}
|
data/lib/madmimi.rb
CHANGED
@@ -146,12 +146,23 @@ class MadMimi
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
-
def list_members(list_name)
|
149
|
+
def list_members(list_name, page = 1, per_page = 30)
|
150
150
|
wrap_with_array('audience', 'member') do
|
151
|
-
do_request(path(:audience_list_members, :list => list_name), :get
|
151
|
+
do_request(path(:audience_list_members, :list => list_name), :get, {
|
152
|
+
:page => page,
|
153
|
+
:per_page => per_page
|
154
|
+
})
|
152
155
|
end
|
153
156
|
end
|
154
157
|
|
158
|
+
def list_size(list_name)
|
159
|
+
do_request(path(:audience_list_size, :list => list_name), :get)
|
160
|
+
end
|
161
|
+
|
162
|
+
def list_size_since(list_name, date)
|
163
|
+
do_request(path(:audience_list_size, :list => list_name, :date => date), :get)
|
164
|
+
end
|
165
|
+
|
155
166
|
def suppressed_since(timestamp, show_suppression_reason = false)
|
156
167
|
do_request(path(:suppressed_since, :timestamp => timestamp), :get, {
|
157
168
|
:show_suppression_reason => show_suppression_reason
|
data/madmimi.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: madmimi 1.1.
|
5
|
+
# stub: madmimi 1.1.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "madmimi"
|
9
|
-
s.version = "1.1.
|
9
|
+
s.version = "1.1.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Nicholas Young", "Marc Heiligers", "Maxim Gladkov"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2015-07-30"
|
15
15
|
s.description = "Send emails, track statistics, and manage your subscriber base with ease."
|
16
16
|
s.email = "nicholas@madmimi.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -63,6 +63,8 @@ Gem::Specification.new do |s|
|
|
63
63
|
"spec/cassettes/delete_list/users_exist.yml",
|
64
64
|
"spec/cassettes/list_members/multiple.yml",
|
65
65
|
"spec/cassettes/list_members/single.yml",
|
66
|
+
"spec/cassettes/list_size/list_exists.yml",
|
67
|
+
"spec/cassettes/list_size_since/list_members.yml",
|
66
68
|
"spec/cassettes/lists/multiple.yml",
|
67
69
|
"spec/cassettes/lists/single.yml",
|
68
70
|
"spec/cassettes/mailing_stats/mailing_does_not_exist.yml",
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.madmimi.com/audience_lists/list%201/list_size
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: username=test%40example.com&api_key=TEST_API_KEY
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 401
|
13
|
+
message: Unauthorized
|
14
|
+
headers:
|
15
|
+
Date:
|
16
|
+
- Thu, 30 Jul 2015 13:12:08 GMT
|
17
|
+
Content-Type:
|
18
|
+
- text/html; charset=utf-8
|
19
|
+
Transfer-Encoding:
|
20
|
+
- chunked
|
21
|
+
Connection:
|
22
|
+
- keep-alive
|
23
|
+
Set-Cookie:
|
24
|
+
- __cfduid=d4542b816ea9a3523d05ac11b4f7f092b1438261928; expires=Fri, 29-Jul-16
|
25
|
+
13:12:08 GMT; path=/; domain=.madmimi.com; HttpOnly
|
26
|
+
- non_eu=true; path=/
|
27
|
+
Status:
|
28
|
+
- 401 Unauthorized
|
29
|
+
X-Ua-Compatible:
|
30
|
+
- IE=Edge,chrome=1
|
31
|
+
Cache-Control:
|
32
|
+
- no-cache
|
33
|
+
X-Request-Id:
|
34
|
+
- c25c8d7d689170cc4a167481fb15df91
|
35
|
+
X-Rack-Cache:
|
36
|
+
- miss
|
37
|
+
Server:
|
38
|
+
- cloudflare-nginx
|
39
|
+
Cf-Ray:
|
40
|
+
- 20e1503a799515f8-JNB
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: Unable to authenticate
|
44
|
+
http_version:
|
45
|
+
recorded_at: Thu, 30 Jul 2015 13:12:08 GMT
|
46
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.madmimi.com/audience_lists/list%201/list_size
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: username=test%40example.com&api_key=TEST_API_KEY
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 401
|
13
|
+
message: Unauthorized
|
14
|
+
headers:
|
15
|
+
Date:
|
16
|
+
- Thu, 30 Jul 2015 13:12:09 GMT
|
17
|
+
Content-Type:
|
18
|
+
- text/html; charset=utf-8
|
19
|
+
Transfer-Encoding:
|
20
|
+
- chunked
|
21
|
+
Connection:
|
22
|
+
- keep-alive
|
23
|
+
Set-Cookie:
|
24
|
+
- __cfduid=dd8c1fee3b57b32820faeeb7368c4b1fa1438261928; expires=Fri, 29-Jul-16
|
25
|
+
13:12:08 GMT; path=/; domain=.madmimi.com; HttpOnly
|
26
|
+
- non_eu=true; path=/
|
27
|
+
Status:
|
28
|
+
- 401 Unauthorized
|
29
|
+
X-Ua-Compatible:
|
30
|
+
- IE=Edge,chrome=1
|
31
|
+
Cache-Control:
|
32
|
+
- no-cache
|
33
|
+
X-Request-Id:
|
34
|
+
- 1bbd9624aa78c4c919e3efb688f37486
|
35
|
+
X-Rack-Cache:
|
36
|
+
- miss
|
37
|
+
Server:
|
38
|
+
- cloudflare-nginx
|
39
|
+
Cf-Ray:
|
40
|
+
- 20e1503f798615ec-JNB
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: Unable to authenticate
|
44
|
+
http_version:
|
45
|
+
recorded_at: Thu, 30 Jul 2015 13:12:09 GMT
|
46
|
+
recorded_with: VCR 2.9.2
|
data/spec/madmimi_spec.rb
CHANGED
@@ -534,6 +534,27 @@ describe MadMimi do
|
|
534
534
|
end
|
535
535
|
end
|
536
536
|
|
537
|
+
context '#list_size' do
|
538
|
+
subject { mad_mimi.list_size('list 1') }
|
539
|
+
|
540
|
+
context 'when list exists', :vcr => { :cassette_name => 'list_size/list_exists' } do
|
541
|
+
|
542
|
+
it 'returns an success message' do
|
543
|
+
expect(subject).to be_truthy
|
544
|
+
end
|
545
|
+
end
|
546
|
+
end
|
547
|
+
|
548
|
+
context '#list_size_since' do
|
549
|
+
subject { mad_mimi.list_size_since('list 1',1409512823) }
|
550
|
+
|
551
|
+
context 'when there are members', :vcr => { :cassette_name => 'list_size_since/list_members' } do
|
552
|
+
it 'returns a success response' do
|
553
|
+
expect(subject).to be_truthy
|
554
|
+
end
|
555
|
+
end
|
556
|
+
end
|
557
|
+
|
537
558
|
context '#suppressed_since' do
|
538
559
|
subject { mad_mimi.suppressed_since(1409512823) }
|
539
560
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: madmimi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Young
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -162,6 +162,8 @@ files:
|
|
162
162
|
- spec/cassettes/delete_list/users_exist.yml
|
163
163
|
- spec/cassettes/list_members/multiple.yml
|
164
164
|
- spec/cassettes/list_members/single.yml
|
165
|
+
- spec/cassettes/list_size/list_exists.yml
|
166
|
+
- spec/cassettes/list_size_since/list_members.yml
|
165
167
|
- spec/cassettes/lists/multiple.yml
|
166
168
|
- spec/cassettes/lists/single.yml
|
167
169
|
- spec/cassettes/mailing_stats/mailing_does_not_exist.yml
|