hominid 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +13 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/hominid.gemspec +3 -3
- data/lib/hominid.rb +2 -2
- data/lib/hominid/campaign.rb +2 -2
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -16,12 +16,24 @@ Please refer to the {Mailchimp API Documentation}[http://www.mailchimp.com/api/1
|
|
16
16
|
|
17
17
|
h = Hominid::API.new('your_api_key')
|
18
18
|
|
19
|
+
You can also override the default configuration by passing in your own when initializing:
|
20
|
+
|
21
|
+
h = Hominid::API.new('your_api_key', {:secure => true, :timeout => 60})
|
22
|
+
|
23
|
+
Finally, and we're not sure why you would want to, but you can use the older versions of the API if you would like:
|
24
|
+
|
25
|
+
h = Hominid::API.new('your_api_key', {:api_version => '1.2'})
|
26
|
+
|
19
27
|
You can then run any of the methods that you find in the {Mailchimp API Documentation}[http://www.mailchimp.com/api/1.3/] against it. Simply convert the names to the more Ruby-like underscored versions. You do not need to pass your api_key to each method, as that is done automatically for you:
|
20
28
|
|
21
29
|
h.get_account_details
|
22
30
|
h.lists
|
23
|
-
h.
|
31
|
+
h.list_subscribe('XXXXXXXXXX', 'joe@public.com', [], 'html', false, true, true, false)
|
32
|
+
h.list_batch_subscribe('XXXXXXXXXX', [{:EMAIL => 'joe@public.com', :EMAIL_TYPE => 'html'}, {:EMAIL => 'jane@doe.com', :EMAIL_TYPE => 'html'}])
|
33
|
+
h.campaign_create('regular', {:list_id => 'XXXXXXXXXX', ...}, {:html => 'Campaign HTML content', ...})
|
24
34
|
h.template_add('template_name', 'Template HTML Code')
|
35
|
+
h.list_interest_grouping_add('XXXXXXXXXX', 'Grouping Title', 'hidden', ['First Group', 'Second Group', 'Third Group'])
|
36
|
+
h.list_static_segment_add('Sample Static Segment')
|
25
37
|
|
26
38
|
The {Mailchimp API}[http://www.mailchimp.com/api/1.3/] now supports pagination for some methods, so certain methods will have the following response:
|
27
39
|
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ require 'jeweler'
|
|
13
13
|
Jeweler::Tasks.new do |gem|
|
14
14
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
15
|
gem.name = "hominid"
|
16
|
-
gem.homepage = "http://github.com/
|
16
|
+
gem.homepage = "http://github.com/terra-firma/hominid"
|
17
17
|
gem.license = "MIT"
|
18
18
|
gem.summary = %Q{Hominid is a Ruby wrapper for the Mailchimp API}
|
19
19
|
gem.description = %Q{Hominid is a Ruby gem that provides a wrapper for interacting with the Mailchimp email marketing service API.}
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.2
|
data/hominid.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{hominid}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Getting"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-24}
|
13
13
|
s.description = %q{Hominid is a Ruby gem that provides a wrapper for interacting with the Mailchimp email marketing service API.}
|
14
14
|
s.email = %q{brian@terra-firma-design.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"test/helper.rb",
|
32
32
|
"test/test_hominid.rb"
|
33
33
|
]
|
34
|
-
s.homepage = %q{http://github.com/
|
34
|
+
s.homepage = %q{http://github.com/terra-firma/hominid}
|
35
35
|
s.licenses = ["MIT"]
|
36
36
|
s.require_paths = ["lib"]
|
37
37
|
s.rubygems_version = %q{1.3.7}
|
data/lib/hominid.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# TODO: Write tests (include mocks for API calls)
|
1
|
+
# TODO: Write tests (include mocks for API calls)
|
2
2
|
require 'openssl'
|
3
3
|
require 'xmlrpc/client'
|
4
4
|
|
@@ -32,7 +32,7 @@ module Hominid
|
|
32
32
|
@config = defaults.merge(config).freeze
|
33
33
|
protocol = @config[:secure] ? 'https' : 'http'
|
34
34
|
@api_key = api_key
|
35
|
-
@chimpApi = XMLRPC::Client.new2("#{protocol}://#{dc}.api.mailchimp.com/#{
|
35
|
+
@chimpApi = XMLRPC::Client.new2("#{protocol}://#{dc}.api.mailchimp.com/#{@config[:api_version]}/", nil, @config[:timeout])
|
36
36
|
end
|
37
37
|
|
38
38
|
def method_missing(api_method, *args) # :nodoc:
|
data/lib/hominid/campaign.rb
CHANGED
@@ -12,8 +12,8 @@ module Hominid
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Find a campaign by name
|
15
|
-
def find_campaigns_by_title(campaign_title)
|
16
|
-
campaigns({:title => campaign_title})['data']
|
15
|
+
def find_campaigns_by_title(campaign_title, *args)
|
16
|
+
campaigns({:title => campaign_title}, *args)['data']
|
17
17
|
end
|
18
18
|
|
19
19
|
# Find campaigns by list name
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 3
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 3.0.
|
8
|
+
- 2
|
9
|
+
version: 3.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brian Getting
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-24 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -116,7 +116,7 @@ files:
|
|
116
116
|
- test/helper.rb
|
117
117
|
- test/test_hominid.rb
|
118
118
|
has_rdoc: true
|
119
|
-
homepage: http://github.com/
|
119
|
+
homepage: http://github.com/terra-firma/hominid
|
120
120
|
licenses:
|
121
121
|
- MIT
|
122
122
|
post_install_message:
|
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
129
|
requirements:
|
130
130
|
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
hash:
|
132
|
+
hash: 1569519064116685422
|
133
133
|
segments:
|
134
134
|
- 0
|
135
135
|
version: "0"
|