mailchimp_api_v3 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mailchimp_api_v3/client.rb +1 -1
- data/lib/mailchimp_api_v3/client/remote.rb +0 -1
- data/lib/mailchimp_api_v3/exception.rb +2 -2
- data/lib/mailchimp_api_v3/member.rb +27 -23
- data/lib/mailchimp_api_v3/version.rb +1 -1
- data/spec/fixtures/cassettes/list.yml +4 -4
- data/spec/fixtures/cassettes/members.yml +540 -93
- data/spec/fixtures/cassettes/members_paging.yml +277 -0
- data/spec/mailchimp_api_v3/members_spec.rb +60 -23
- data/spec/support/api_key.rb +1 -1
- metadata +3 -1
@@ -0,0 +1,277 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists?count=500&exclude_fields=lists._links,_links&offset=0
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*; q=0.5, application/xml"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
Authorization:
|
15
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
16
|
+
User-Agent:
|
17
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Content-Length:
|
28
|
+
- '1647'
|
29
|
+
X-Request-Id:
|
30
|
+
- 652e3f6c-ccf1-41e9-b759-a18c7732e8a7
|
31
|
+
Link:
|
32
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json>; rel="describedBy"
|
33
|
+
Vary:
|
34
|
+
- Accept-Encoding
|
35
|
+
Date:
|
36
|
+
- Wed, 01 Jul 2015 14:30:32 GMT
|
37
|
+
Connection:
|
38
|
+
- keep-alive
|
39
|
+
body:
|
40
|
+
encoding: ASCII-8BIT
|
41
|
+
string: '{"lists":[{"id":"e73f5910ca","name":"My first list","contact":{"company":"InSite
|
42
|
+
Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"","zip":"E14
|
43
|
+
7DQ","country":"262","phone":"07917153555"},"permission_reminder":"Opt-in
|
44
|
+
only","use_archive_bar":true,"campaign_defaults":{"from_name":"Sam Sayers","from_email":"sam@sayers.cc","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-06-27T14:49:18+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/brGTO9","subscribe_url_long":"http://insitearts.us11.list-manage.com/subscribe?u=1dbca289fd41b54838bcbb501&id=e73f5910ca","beamer_address":"us11-6692a2b3c3-bcd2a8b144@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":2,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":2,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"last_sub_date":"2015-06-27T14:50:39+00:00","last_unsub_date":""}}],"_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json"},{"rel":"parent","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json"},{"rel":"create","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists","method":"POST","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Instance.json"}],"total_items":1}'
|
45
|
+
http_version:
|
46
|
+
recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
|
47
|
+
- request:
|
48
|
+
method: get
|
49
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links,_links&offset=0
|
50
|
+
body:
|
51
|
+
encoding: US-ASCII
|
52
|
+
string: ''
|
53
|
+
headers:
|
54
|
+
Accept:
|
55
|
+
- "*/*; q=0.5, application/xml"
|
56
|
+
Accept-Encoding:
|
57
|
+
- gzip, deflate
|
58
|
+
Authorization:
|
59
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
60
|
+
User-Agent:
|
61
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
62
|
+
response:
|
63
|
+
status:
|
64
|
+
code: 200
|
65
|
+
message: OK
|
66
|
+
headers:
|
67
|
+
Server:
|
68
|
+
- nginx
|
69
|
+
Content-Type:
|
70
|
+
- application/json; charset=utf-8
|
71
|
+
Content-Length:
|
72
|
+
- '8557'
|
73
|
+
X-Request-Id:
|
74
|
+
- acf5f935-1ae1-4851-ad92-357d60b3ff2a
|
75
|
+
Link:
|
76
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
77
|
+
rel="describedBy"
|
78
|
+
Vary:
|
79
|
+
- Accept-Encoding
|
80
|
+
Date:
|
81
|
+
- Wed, 01 Jul 2015 14:30:32 GMT
|
82
|
+
Connection:
|
83
|
+
- keep-alive
|
84
|
+
body:
|
85
|
+
encoding: ASCII-8BIT
|
86
|
+
string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
87
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
88
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
89
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
90
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
91
|
+
19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
|
92
|
+
Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
93
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
94
|
+
11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
|
95
|
+
Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
96
|
+
22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
97
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"ddf039f00e38829042f5f52d2380f7d3","email_address":"somebody@example.com","unique_email_id":"d72b28f1ac","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Bela
|
98
|
+
Hanratty","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
99
|
+
07:16:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"80327f363d933cfc79f006cdfc97c1ab","email_address":"somebody@example.com","unique_email_id":"d3c8853070","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Esteban
|
100
|
+
Rodriguez","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
101
|
+
11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"b8fb267cb40768c9b709b6cd74773def","email_address":"somebody@example.com","unique_email_id":"2d2edf878b","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"HNO
|
102
|
+
Cleland","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
103
|
+
02:23:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"}],"list_id":"c6d27c12c2","_links":[{"rel":"self","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"parent","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"create","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"POST","schema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"}],"total_items":37}'
|
104
|
+
http_version:
|
105
|
+
recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
|
106
|
+
- request:
|
107
|
+
method: get
|
108
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links,_links&offset=10
|
109
|
+
body:
|
110
|
+
encoding: US-ASCII
|
111
|
+
string: ''
|
112
|
+
headers:
|
113
|
+
Accept:
|
114
|
+
- "*/*; q=0.5, application/xml"
|
115
|
+
Accept-Encoding:
|
116
|
+
- gzip, deflate
|
117
|
+
Authorization:
|
118
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
119
|
+
User-Agent:
|
120
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
121
|
+
response:
|
122
|
+
status:
|
123
|
+
code: 200
|
124
|
+
message: OK
|
125
|
+
headers:
|
126
|
+
Server:
|
127
|
+
- nginx
|
128
|
+
Content-Type:
|
129
|
+
- application/json; charset=utf-8
|
130
|
+
Content-Length:
|
131
|
+
- '8557'
|
132
|
+
X-Request-Id:
|
133
|
+
- acf5f935-1ae1-4851-ad92-357d60b3ff2a
|
134
|
+
Link:
|
135
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
136
|
+
rel="describedBy"
|
137
|
+
Vary:
|
138
|
+
- Accept-Encoding
|
139
|
+
Date:
|
140
|
+
- Wed, 01 Jul 2015 14:30:32 GMT
|
141
|
+
Connection:
|
142
|
+
- keep-alive
|
143
|
+
body:
|
144
|
+
encoding: ASCII-8BIT
|
145
|
+
string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
146
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
147
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
148
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
149
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
150
|
+
19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
|
151
|
+
Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
152
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
153
|
+
11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
|
154
|
+
Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
155
|
+
22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
156
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"ddf039f00e38829042f5f52d2380f7d3","email_address":"somebody@example.com","unique_email_id":"d72b28f1ac","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Bela
|
157
|
+
Hanratty","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
158
|
+
07:16:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"80327f363d933cfc79f006cdfc97c1ab","email_address":"somebody@example.com","unique_email_id":"d3c8853070","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Esteban
|
159
|
+
Rodriguez","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
160
|
+
11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"b8fb267cb40768c9b709b6cd74773def","email_address":"somebody@example.com","unique_email_id":"2d2edf878b","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"HNO
|
161
|
+
Cleland","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
162
|
+
02:23:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"}],"list_id":"c6d27c12c2","_links":[{"rel":"self","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"parent","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"create","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"POST","schema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"}],"total_items":37}'
|
163
|
+
http_version:
|
164
|
+
recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
|
165
|
+
- request:
|
166
|
+
method: get
|
167
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links,_links&offset=20
|
168
|
+
body:
|
169
|
+
encoding: US-ASCII
|
170
|
+
string: ''
|
171
|
+
headers:
|
172
|
+
Accept:
|
173
|
+
- "*/*; q=0.5, application/xml"
|
174
|
+
Accept-Encoding:
|
175
|
+
- gzip, deflate
|
176
|
+
Authorization:
|
177
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
178
|
+
User-Agent:
|
179
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
180
|
+
response:
|
181
|
+
status:
|
182
|
+
code: 200
|
183
|
+
message: OK
|
184
|
+
headers:
|
185
|
+
Server:
|
186
|
+
- nginx
|
187
|
+
Content-Type:
|
188
|
+
- application/json; charset=utf-8
|
189
|
+
Content-Length:
|
190
|
+
- '8557'
|
191
|
+
X-Request-Id:
|
192
|
+
- acf5f935-1ae1-4851-ad92-357d60b3ff2a
|
193
|
+
Link:
|
194
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
195
|
+
rel="describedBy"
|
196
|
+
Vary:
|
197
|
+
- Accept-Encoding
|
198
|
+
Date:
|
199
|
+
- Wed, 01 Jul 2015 14:30:32 GMT
|
200
|
+
Connection:
|
201
|
+
- keep-alive
|
202
|
+
body:
|
203
|
+
encoding: ASCII-8BIT
|
204
|
+
string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
205
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
206
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
207
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
208
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
209
|
+
19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
|
210
|
+
Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
211
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
212
|
+
11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
|
213
|
+
Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
214
|
+
22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
215
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"ddf039f00e38829042f5f52d2380f7d3","email_address":"somebody@example.com","unique_email_id":"d72b28f1ac","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Bela
|
216
|
+
Hanratty","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
217
|
+
07:16:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"80327f363d933cfc79f006cdfc97c1ab","email_address":"somebody@example.com","unique_email_id":"d3c8853070","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Esteban
|
218
|
+
Rodriguez","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
219
|
+
11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"b8fb267cb40768c9b709b6cd74773def","email_address":"somebody@example.com","unique_email_id":"2d2edf878b","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"HNO
|
220
|
+
Cleland","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
221
|
+
02:23:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":3,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"}],"list_id":"c6d27c12c2","_links":[{"rel":"self","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json"},{"rel":"parent","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2","method":"GET","targetSchema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Instance.json"},{"rel":"create","href":"https://us3.api.mailchimp.com/3.0/lists/c6d27c12c2/members","method":"POST","schema":"https://us3.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"}],"total_items":37}'
|
222
|
+
http_version:
|
223
|
+
recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
|
224
|
+
- request:
|
225
|
+
method: get
|
226
|
+
uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists/e73f5910ca/members?count=10&exclude_fields=members._links,_links&offset=30
|
227
|
+
body:
|
228
|
+
encoding: US-ASCII
|
229
|
+
string: ''
|
230
|
+
headers:
|
231
|
+
Accept:
|
232
|
+
- "*/*; q=0.5, application/xml"
|
233
|
+
Accept-Encoding:
|
234
|
+
- gzip, deflate
|
235
|
+
Authorization:
|
236
|
+
- apikey <%= ENV['MAILCHIMP_API_KEY'] %>
|
237
|
+
User-Agent:
|
238
|
+
- Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
|
239
|
+
response:
|
240
|
+
status:
|
241
|
+
code: 200
|
242
|
+
message: OK
|
243
|
+
headers:
|
244
|
+
Server:
|
245
|
+
- nginx
|
246
|
+
Content-Type:
|
247
|
+
- application/json; charset=utf-8
|
248
|
+
Content-Length:
|
249
|
+
- '8557'
|
250
|
+
X-Request-Id:
|
251
|
+
- acf5f935-1ae1-4851-ad92-357d60b3ff2a
|
252
|
+
Link:
|
253
|
+
- <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json>;
|
254
|
+
rel="describedBy"
|
255
|
+
Vary:
|
256
|
+
- Accept-Encoding
|
257
|
+
Date:
|
258
|
+
- Wed, 01 Jul 2015 14:30:32 GMT
|
259
|
+
Connection:
|
260
|
+
- keep-alive
|
261
|
+
body:
|
262
|
+
encoding: ASCII-8BIT
|
263
|
+
string: '{"members":[{"id":"3387277a449fa6fe2d66f5185ef23d0d","email_address":"somebody@example.com","unique_email_id":"130333fe23","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
264
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
265
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"9f4ce260f5ba979eed17469c906d0215","email_address":"somebody@example.com","unique_email_id":"35bf97a7b5","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"dave","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
266
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"1c45af27937ca4047416dd5e39094a4f","email_address":"somebody@example.com","unique_email_id":"8f0a4838ed","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Omar
|
267
|
+
Liess","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
268
|
+
19:58:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"5294b6b042c69a70598fef2b5532451f","email_address":"somebody@example.com","unique_email_id":"83dfb3427c","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Chris
|
269
|
+
Handley","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.6667,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
270
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"06dc2c772ea2170f5a212dde3c14b793","email_address":"somebody@example.com","unique_email_id":"a81e1bbf30","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"shameelkhan363","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":1,"avg_click_rate":0.3333},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
271
|
+
11:06:16","member_rating":4,"last_changed":"2015-02-24T11:06:16+00:00","language":"en","vip":false,"email_client":"","location":{"latitude":52.6474,"longitude":-2.70793,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"},{"id":"884db83a3347f02271fc2b26c742111b","email_address":"somebody@example.com","unique_email_id":"64404b810a","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"Reuben
|
272
|
+
Levy","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"2015-02-24
|
273
|
+
22:18:00","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24 11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":0,"longitude":0,"gmtoff":0,"dstoff":0,"country_code":"","timezone":""},"list_id":"c6d27c12c2"},{"id":"31722da12b62b65a02aaddad2491fb10","email_address":"somebody@example.com","unique_email_id":"7e294f60f2","email_type":"html","status":"subscribed","merge_fields":{"FNAME":"","LNAME":"bowoproperties","MMERGE3":"","MMERGE4":"","MMERGE5":0,"MMERGE6":"","MMERGE7":"","MMERGE8":"","MMERGE9":"","MMERGE10":"","MMERGE11":""},"interests":{"bcb5bf9704":false,"a3466d48ef":false,"108f2c6b6e":false},"stats":{"avg_open_rate":0.3333,"avg_click_rate":0},"ip_signup":"","timestamp_signup":"","ip_opt":"85.92.193.106","timestamp_opt":"2015-02-24
|
274
|
+
11:06:16","member_rating":2,"last_changed":"2015-02-24T11:06:16+00:00","language":"","vip":false,"email_client":"","location":{"latitude":52.6045,"longitude":-2.60185,"gmtoff":0,"dstoff":1,"country_code":"GB","timezone":"Atlantic/Faroe"},"list_id":"c6d27c12c2"}],"total_items":37}'
|
275
|
+
http_version:
|
276
|
+
recorded_at: Wed, 01 Jul 2015 14:30:32 GMT
|
277
|
+
recorded_with: VCR 2.9.3
|
@@ -2,33 +2,70 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'mailchimp_api_v3'
|
4
4
|
|
5
|
-
describe Mailchimp::List::Members
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
it 'is the expected class' do
|
12
|
-
expect(members).to be_a Mailchimp::List::Members
|
13
|
-
end
|
5
|
+
describe Mailchimp::List::Members do
|
6
|
+
context 'paging', vcr: { cassette_name: 'members_paging', allow_playback_repeats: true } do
|
7
|
+
let(:page_size) { 10 }
|
8
|
+
let(:member_count) { 37 }
|
9
|
+
let(:list) { Mailchimp.connect.lists.first }
|
10
|
+
let(:members) { list.members 'page_size' => page_size }
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
it 'is the expected class' do
|
13
|
+
expect(members).to be_a Mailchimp::List::Members
|
14
|
+
end
|
18
15
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
expect(counts).to eq [page_size, page_size, page_size, 7]
|
23
|
-
end
|
16
|
+
it 'has a count' do
|
17
|
+
expect(members.count).to eq member_count
|
18
|
+
end
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
it 'returns pages of members' do
|
21
|
+
counts = []
|
22
|
+
members.find_in_pages { |p| counts << p.count }
|
23
|
+
expect(counts).to eq [page_size, page_size, page_size, 7]
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns all members by paging' do
|
27
|
+
count = 0
|
28
|
+
members.find_each { |_| count += 1 }
|
29
|
+
expect(count).to eq member_count
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'has a Member for each item' do
|
33
|
+
expect(members.sample).to be_a Mailchimp::List::Member
|
34
|
+
end
|
29
35
|
end
|
30
36
|
|
31
|
-
|
32
|
-
|
37
|
+
context 'adding and deleting' do
|
38
|
+
context '#create, #find_by, #delete, #first_or_create', vcr: { cassette_name: 'members' } do
|
39
|
+
let(:list) { Mailchimp.connect.lists 'My first list' }
|
40
|
+
let(:members) { list.members }
|
41
|
+
|
42
|
+
it 'can add and delete a new instance' do
|
43
|
+
name = 'Cat Sayers'
|
44
|
+
data = { name: name, email_address: 'cat@sayers.cc', status: 'subscribed' }
|
45
|
+
|
46
|
+
# #create
|
47
|
+
expect { members.create data }.to change { list.members.count }.by(1)
|
48
|
+
expect { members.create data }.to raise_error Mailchimp::Exception::Duplicate
|
49
|
+
|
50
|
+
# #find_by
|
51
|
+
member = list.members.find_by name: name
|
52
|
+
expect(member).to be_a Mailchimp::List::Member
|
53
|
+
expect(member.name).to eq name
|
54
|
+
|
55
|
+
# #first_or_create finds the same instance
|
56
|
+
member2 = list.members.first_or_create name: name
|
57
|
+
expect(member.id).to eq(member2.id)
|
58
|
+
|
59
|
+
# #delete
|
60
|
+
expect { member.delete }.to change { list.members.count }.by(-1)
|
61
|
+
|
62
|
+
# #first_or_create creates a new instance
|
63
|
+
name = 'Dan Sayers'
|
64
|
+
data = { name: name, email_address: 'dan@sayers.cc', status: 'subscribed' }
|
65
|
+
member = members.first_or_create data
|
66
|
+
expect(member.name).to eq name
|
67
|
+
member.delete # Tidy up
|
68
|
+
end
|
69
|
+
end
|
33
70
|
end
|
34
71
|
end
|
data/spec/support/api_key.rb
CHANGED
@@ -2,7 +2,7 @@ require 'yaml'
|
|
2
2
|
|
3
3
|
unless ENV['MAILCHIMP_API_KEY']
|
4
4
|
if File.exist?('api_key.yml')
|
5
|
-
ENV['MAILCHIMP_API_KEY'] = YAML.load_file('api_key.yml')['api_key']
|
5
|
+
ENV['MAILCHIMP_API_KEY'] = YAML.load_file('api_key.yml')['api_key'] # api_key.yml is ignored in .gitignore
|
6
6
|
else
|
7
7
|
ENV['MAILCHIMP_API_KEY'] = 'vcr_playback-us11' # Will successfully replay the VCR cassettes
|
8
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailchimp_api_v3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xenapto
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- spec/fixtures/cassettes/mailchimp.yml
|
248
248
|
- spec/fixtures/cassettes/member.yml
|
249
249
|
- spec/fixtures/cassettes/members.yml
|
250
|
+
- spec/fixtures/cassettes/members_paging.yml
|
250
251
|
- spec/mailchimp_api_v3/account_spec.rb
|
251
252
|
- spec/mailchimp_api_v3/client_spec.rb
|
252
253
|
- spec/mailchimp_api_v3/exception_spec.rb
|
@@ -299,6 +300,7 @@ test_files:
|
|
299
300
|
- spec/fixtures/cassettes/mailchimp.yml
|
300
301
|
- spec/fixtures/cassettes/member.yml
|
301
302
|
- spec/fixtures/cassettes/members.yml
|
303
|
+
- spec/fixtures/cassettes/members_paging.yml
|
302
304
|
- spec/mailchimp_api_v3/account_spec.rb
|
303
305
|
- spec/mailchimp_api_v3/client_spec.rb
|
304
306
|
- spec/mailchimp_api_v3/exception_spec.rb
|