chimp_contact 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/chimp_contact.gemspec +27 -0
- data/lib/chimp_contact.rb +5 -0
- data/lib/chimp_contact/converter.rb +56 -0
- data/lib/chimp_contact/template.rb +21 -0
- data/lib/chimp_contact/version.rb +3 -0
- data/spec/chimp_contact_spec.rb +68 -0
- data/spec/fixtures/template.html +1 -0
- data/spec/fixtures/template_with_inline_css.html +1 -0
- metadata +122 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "chimp_contact/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "chimp_contact"
|
7
|
+
s.version = ChimpContact::VERSION
|
8
|
+
s.authors = ["Robert Williams", "Andrew Warburton"]
|
9
|
+
s.email = ["rob@r-williams.com", "andy@warburton.me"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Converts mailchimp templates to constant contact format}
|
12
|
+
s.description = %q{Converts mailchimp templates to constant contact format but more verbose}
|
13
|
+
|
14
|
+
s.rubyforge_project = "chimp_contact"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_development_dependency "rspec"
|
22
|
+
s.add_development_dependency "rake"
|
23
|
+
s.add_development_dependency "fakeweb"
|
24
|
+
# specify any dependencies here; for example:
|
25
|
+
s.add_runtime_dependency "nokogiri"
|
26
|
+
s.add_runtime_dependency "hominid"
|
27
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module ChimpContact
|
2
|
+
class Converter
|
3
|
+
|
4
|
+
COPYRIGHT = [
|
5
|
+
'Copyright (c) 1996-2011 Constant Contact. All rights reserved. Except as permitted under a separate',
|
6
|
+
'written agreement with Constant Contact, neither the Constant Contact software, nor any content that appears on any Constant Contact site,',
|
7
|
+
'including but not limited to, web pages, newsletters, or templates may be reproduced, republished, repurposed, or distributed without the',
|
8
|
+
'prior written permission of Constant Contact. For inquiries regarding reproduction or distribution of any Constant Contact material, please',
|
9
|
+
'contact legal@constantcontact.com.'
|
10
|
+
]
|
11
|
+
|
12
|
+
def initialize(document, options = {})
|
13
|
+
@document = document
|
14
|
+
@params = options[:params] || {}
|
15
|
+
@title = options[:title] || "Newsletter"
|
16
|
+
end
|
17
|
+
|
18
|
+
def convert
|
19
|
+
strip_mail_chimp_attributes
|
20
|
+
insert_copyright
|
21
|
+
remove_no_cc
|
22
|
+
add_url_parameters
|
23
|
+
replace_title
|
24
|
+
@document
|
25
|
+
end
|
26
|
+
|
27
|
+
protected
|
28
|
+
def strip_mail_chimp_attributes
|
29
|
+
@document.xpath('//*').each { |e| e.attributes.each { |k,v| v.remove if k =~ /^mc/ } }
|
30
|
+
end
|
31
|
+
|
32
|
+
def insert_copyright
|
33
|
+
body_tag = @document.at_xpath('//body')
|
34
|
+
copyright_tag = Nokogiri::XML::Node.new("CopyRight", @document)
|
35
|
+
copyright_tag.content = COPYRIGHT.join("\n")
|
36
|
+
body_tag.children.first.add_previous_sibling(copyright_tag)
|
37
|
+
end
|
38
|
+
|
39
|
+
def remove_no_cc
|
40
|
+
no_cc = @document.css(".no_cc")
|
41
|
+
no_cc.remove
|
42
|
+
end
|
43
|
+
|
44
|
+
def add_url_parameters
|
45
|
+
unless @params.empty?
|
46
|
+
param_string = @params.inject([]){|result, param| result << "#{param[0]}=#{param[1]}"; result}.join("&")
|
47
|
+
@document.xpath('//@href').each { |e| e.value += "?#{param_string}" unless e.value == "" }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def replace_title
|
52
|
+
title_tag = @document.at_xpath('//title')
|
53
|
+
title_tag.content = @title
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module ChimpContact
|
2
|
+
|
3
|
+
class Template
|
4
|
+
|
5
|
+
def initialize(hominid, template_id)
|
6
|
+
@hominid, @template_id = hominid, template_id
|
7
|
+
end
|
8
|
+
|
9
|
+
def template_info
|
10
|
+
@template_info ||= @hominid.template_info(@template_id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def content
|
14
|
+
template_info["source"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def convert_to_inline_css
|
18
|
+
@hominid.inline_css(content, true)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/chimp_contact.rb')
|
2
|
+
require 'fakeweb'
|
3
|
+
|
4
|
+
def file_fixture(filename)
|
5
|
+
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename.to_s}")).read
|
6
|
+
end
|
7
|
+
|
8
|
+
describe ChimpContact::Template do
|
9
|
+
|
10
|
+
before do
|
11
|
+
ChimpContact::Template.any_instance.stub(:content).with(file_fixture("template.html"))
|
12
|
+
ChimpContact::Template.any_instance.stub(:convert_to_inline_css).with(file_fixture("template_with_inline_css.html"))
|
13
|
+
end
|
14
|
+
|
15
|
+
let :template do
|
16
|
+
ChimpContact::Template.new(
|
17
|
+
Hominid::API.new('fred-us2'), 'whatever'
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
it { true.should eq(true)}
|
22
|
+
end
|
23
|
+
|
24
|
+
describe ChimpContact::Converter do
|
25
|
+
|
26
|
+
let :converter do
|
27
|
+
ChimpContact::Converter.new(Nokogiri::HTML(%Q{
|
28
|
+
<title>shitty mailchimp tag of doob</title>
|
29
|
+
<a href="" mc:editable='link'></a>
|
30
|
+
<div id='footer' class='no_cc'></div>
|
31
|
+
<a href="http://www.google.co.uk"></a>
|
32
|
+
<img src="image.jpg">
|
33
|
+
<br>
|
34
|
+
}), :params => {:param1 => 1, :param2 => 1})
|
35
|
+
end
|
36
|
+
|
37
|
+
subject {converter.convert.to_xhtml}
|
38
|
+
|
39
|
+
it 'should find attributes that start with mc: and remove them' do
|
40
|
+
should include('<a href=""></a>')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should add the copyright tag just after the body tag' do
|
44
|
+
should include("<CopyRight>")
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should remove the any element with the .no_cc class' do
|
48
|
+
should_not include('<div id="footer" class="no_cc">')
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should add ?param1=1¶m2=1 to the end of all urls' do
|
52
|
+
should include('<a href="http://www.google.co.uk?param1=1&param2=1"></a>')
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'should replace the title tag' do
|
56
|
+
should include('<title>Newsletter</title>')
|
57
|
+
end
|
58
|
+
|
59
|
+
context "converting to XHTML" do
|
60
|
+
it 'should close img tags' do
|
61
|
+
should include('<img src="image.jpg" />')
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should close all br tags' do
|
65
|
+
should include('<br />')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<h3>\n\t<span style=\"font-size:18px;\">We’re having a Huge Stock Clearance for the End of July – and you’re invited!</span></h3>\n<span style=\"font-size:18px;\">Feast your eyes upon...</span><br />\n<ul>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\">5% Off EVERYTHING – With Coupon Code “CLEARANCE”</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/hp/ink-cartridges\">2 for £10 On Selected HP Refilled Ink</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/epson/ink-cartridges\">A Free Black With Every Epson Compatible Multipack</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/canon/ink-cartridges\">Select Canon Compatible Multipacks are Buy One Get One Free</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/brother/ink-cartridges\">Free Blacks with Select Brother Compatible Multipacks</a></span></p>\n\t</li>\n</ul>\n<br />\n<span style=\"font-size:18px;\">To Enjoy Your 5% Discount, Don't Forget to Enter the Coupon Code "CLEARANCE" in your basket before proceeding to the checkout!</span><br />\n<h3>\n\t<span style=\"font-size:18px;\">And Don’t Forget The Benefits of Shopping at Stinkyink</span></h3>\n<p>\n\t<span style=\"font-size:18px;\"><strong>Every Order</strong> Enjoys Free Delivery!<br />\n\t<strong>Every Item</strong> Enjoys a 6-month Guarantee!<br />\n\t<strong>Every Customer</strong> Enjoys a Free Pen with Their Order!<br />\n\t<br />\n\tCan’t wait and want to jump straight to your Product? <a href=\"http://www.stinkyinkshop.co.uk/\">Find Your Printer Now!</a></span></p>\n<div style=\"text-align: center;\">\n\t </div>\n<p>\n\t </p>\n<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\"><img alt=\"\" border=\"0\" height=\"96\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/startshopping_320_96.jpg\" width=\"320\" /></a></span> <!-- RIGHT COLUMN -->", "footer"=>" \n <p>\n *|IFNOT:ARCHIVE_PAGE|*\n *|LIST:DESCRIPTION|* <br>\n </p><p>*|HTML:LIST_ADDRESS_HTML|*</p>\n *|END:IF|*\n \n <p>\n <a href=\"*|UNSUB|*\">unsubscribe from this list</a> | <a href=\"*|UPDATE_PROFILE|*\">update subscription preferences</a>\n *|IFNOT:ARCHIVE_PAGE|*<br><a href=\"*|ARCHIVE|*\">view email in browser</a>*|END:IF|* \n </p>\n ", "header"=>"<a href=\"http://www.stinkyinkshop.co.uk\"><img alt=\"\" border=\"0\" height=\"211\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/top.jpg\" width=\"600\" /><br />\n<img alt=\"\" border=\"0\" height=\"243\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/one.jpg\" width=\"290\" /><img alt=\"\" border=\"0\" height=\"243\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/three.jpg\" width=\"290\" /><br />\n<img alt=\"\" border=\"0\" height=\"243\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/four.jpg\" width=\"290\" /><img alt=\"\" border=\"0\" height=\"242\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/two.jpg\" width=\"290\" /><br />\n<img alt=\"\" border=\"0\" height=\"243\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/five.jpg\" width=\"290\" /><img alt=\"\" border=\"0\" height=\"243\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/six.jpg\" width=\"290\" /><br />\n</a> ", "sidebar"=>"<!-- left column --><!-- MANUFACTURER LINKS -->\n<p style=\"text-align: center;\">\n\t<a href=\"http://www.stinkyinkshop.co.uk/\"><strong>Browse By Manufacturer</strong></a></p>\n<p id=\"man\">\n\t<br />\n\t<a href=\"http://www.stinkyinkshop.co.uk/hp/ink-cartridges\"><img alt=\"HP\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/hp.jpg\" /></a> <a href=\"http://www.stinkyinkshop.co.uk/canon/ink-cartridges\"><img alt=\"Canon\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/canon.jpg\" /></a> <a href=\"http://www.stinkyinkshop.co.uk/epson/ink-cartridges\"><img alt=\"Epson\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/epson.jpg\" /></a> <a href=\"http://www.stinkyinkshop.co.uk/brother/ink-cartridges\"><img alt=\"Brother\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/brother.jpg\" /></a> <a href=\"http://www.stinkyinkshop.co.uk/lexmark/ink-cartridges\"><br />\n\t<img alt=\"Lexmark\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/lexmark.jpg\" /></a> <a href=\"http://www.stinkyinkshop.co.uk/dell/ink-cartridges\"><img alt=\"Dell\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/dell.jpg\" /></a> <a href=\"http://www.stinkyinkshop.co.uk/samsung/ink-cartridges\"><img alt=\"Samsung\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/samsung.jpg\" /></a><br />\n\t<br />\n\t<br />\n\t<strong></strong></p>\n<p style=\"text-align: center;\">\n\t<strong>Talk To Us!</strong></p>\n<!-- SOCIAL LINKS --><p>\n\t<a href=\"http://blog.stinkyinkshop.co.uk\"><img alt=\"Read Our Blog!\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/blog.png\" /></a> <a href=\"http://twitter.com/stinky_ink\"><img alt=\"Follow us on Twitter\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/twitter.png\" /></a> <a href=\"http://img.mailchimp.com/404-stinkyinkshop\"><img alt=\"Like us on Facebook\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/facebook.png\" /></a></p>\n"}, "sections"=>["content", "footer", "header", "sidebar"], "source"=>"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta property=\"og:title\" content=\"*|MC:SUBJECT|*\"> \n <title>*|MC:SUBJECT|*</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n \n <style type=\"text/css\">\n\t\thtml,body{\n\t\t\tbackground-color:#fff;\n\t\t\tpadding:0;\n\t\t\tmargin:0;\n\t\t}\n\t\t#wrapper{\n\t\t\twidth:600px;\n\t\t\tmargin:0px auto 20px auto;\n\t\t}\n\t\tbody{\n\t\t\tfont-size:13px;\n\t\t\tfont-family:arial, sans-serif;\n\t\t\tline-height:20px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:left;\n\t\t}\n\t\tp{\n\t\t\tfont-size:13px;\n\t\t\tfont-family:arial, sans-serif;\n\t\t\tline-height:20px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:center;\n\t\t}\n\t\th2,h3{\n\t\t\tfont-size:18px;\n\t\t\tfont-family:'arial rounded mt bold', arial, sans-serif;\n\t\t\tline-height:22px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:center;\n\t\t}\n\t\ta img{\n\t\t\tborder:none;\n\t\t}\n\t\t#man img{\n\t\t\tmargin-bottom:5px;\n\t\t}\n\t\t#man{\n\t\t\tpadding-bottom:20px;\n\t\t}\n\t\t#footer{\n\t\t\tborder:1px solid #ccc;\n\t\t\tbackground-color:#eee;\n\t\t\tpadding:10px 0;\n\t\t\ttext-align:center;\n\t\t\tmargin:50px auto 0 auto;\n\t\t\twidth:600px;\n\t\t}\n\t\t#footer p{\n\t\t\ttext-align:center;\n\t\t\tfont-size:11px;\n\t\t}\n</style></head>\n <body style=\"text-align: center;\">\n <center>\n <div id=\"wrapper\">\n <table width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td>\n <!-- CONTENT -->\n <div mc:edit=\"content\"><h3>\n\t<span style=\"font-size:18px;\">We’re having a Huge Stock Clearance for the End of July – and you’re invited!</span></h3>\n<span style=\"font-size:18px;\">Feast your eyes upon...</span><br>\n<ul>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\">5% Off EVERYTHING – With Coupon Code “CLEARANCE”</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/hp/ink-cartridges\">2 for £10 On Selected HP Refilled Ink</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/epson/ink-cartridges\">A Free Black With Every Epson Compatible Multipack</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/canon/ink-cartridges\">Select Canon Compatible Multipacks are Buy One Get One Free</a></span></p>\n\t</li>\n\t<li>\n\t\t<p>\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/brother/ink-cartridges\">Free Blacks with Select Brother Compatible Multipacks</a></span></p>\n\t</li>\n</ul>\n<br>\n<span style=\"font-size:18px;\">To Enjoy Your 5% Discount, Don't Forget to Enter the Coupon Code "CLEARANCE" in your basket before proceeding to the checkout!</span><br>\n<h3>\n\t<span style=\"font-size:18px;\">And Don’t Forget The Benefits of Shopping at Stinkyink</span></h3>\n<p>\n\t<span style=\"font-size:18px;\"><strong>Every Order</strong> Enjoys Free Delivery!<br>\n\t<strong>Every Item</strong> Enjoys a 6-month Guarantee!<br>\n\t<strong>Every Customer</strong> Enjoys a Free Pen with Their Order!<br>\n\t<br>\n\tCan’t wait and want to jump straight to your Product? <a href=\"http://www.stinkyinkshop.co.uk/\">Find Your Printer Now!</a></span></p>\n<div style=\"text-align: center;\">\n\t </div>\n<p>\n\t </p>\n<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\"><img alt=\"\" border=\"0\" height=\"96\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/startshopping_320_96.jpg\" width=\"320\"></a></span> <!-- RIGHT COLUMN --></div>\n <!-- FOOTER --> \n <div id=\"footer\" mc:edit=\"footer\"> \n <p>\n *|IFNOT:ARCHIVE_PAGE|*\n *|LIST:DESCRIPTION|* <br>\n </p><p>*|HTML:LIST_ADDRESS_HTML|*</p>\n *|END:IF|*\n \n <p>\n <a href=\"*|UNSUB|*\">unsubscribe from this list</a> | <a href=\"*|UPDATE_PROFILE|*\">update subscription preferences</a>\n *|IFNOT:ARCHIVE_PAGE|*<br><a href=\"*|ARCHIVE|*\">view email in browser</a>*|END:IF|* \n </p>\n </div> \n </td>\n </tr>\n </table>\n </div>\n </center>\n </body>\n</html>", "preview"=>"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" style=\"background-color: #fff;padding: 0;margin: 0;\">\n <head>\n <meta property=\"og:title\" content=\"*|MC:SUBJECT|*\"> \n <title>*|MC:SUBJECT|*</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n \n <style type=\"text/css\">\n\t\thtml,body{\n\t\t\tbackground-color:#fff;\n\t\t\tpadding:0;\n\t\t\tmargin:0;\n\t\t}\n\t\t#wrapper{\n\t\t\twidth:600px;\n\t\t\tmargin:0px auto 20px auto;\n\t\t}\n\t\tbody{\n\t\t\tfont-size:13px;\n\t\t\tfont-family:arial, sans-serif;\n\t\t\tline-height:20px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:left;\n\t\t}\n\t\tp{\n\t\t\tfont-size:13px;\n\t\t\tfont-family:arial, sans-serif;\n\t\t\tline-height:20px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:center;\n\t\t}\n\t\th2,h3{\n\t\t\tfont-size:18px;\n\t\t\tfont-family:'arial rounded mt bold', arial, sans-serif;\n\t\t\tline-height:22px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:center;\n\t\t}\n\t\ta img{\n\t\t\tborder:none;\n\t\t}\n\t\t#man img{\n\t\t\tmargin-bottom:5px;\n\t\t}\n\t\t#man{\n\t\t\tpadding-bottom:20px;\n\t\t}\n\t\t#footer{\n\t\t\tborder:1px solid #ccc;\n\t\t\tbackground-color:#eee;\n\t\t\tpadding:10px 0;\n\t\t\ttext-align:center;\n\t\t\tmargin:50px auto 0 auto;\n\t\t\twidth:600px;\n\t\t}\n\t\t#footer p{\n\t\t\ttext-align:center;\n\t\t\tfont-size:11px;\n\t\t}\n</style></head>\n <body style=\"text-align: center;background-color: #fff;padding: 0;margin: 0;font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;\">\n <center>\n <div id=\"wrapper\" style=\"width: 600px;margin: 0px auto 20px auto;\">\n <table width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td>\n <!-- CONTENT -->\n <div><h3 style=\"font-size: 18px;font-family: 'arial rounded mt bold', arial, sans-serif;line-height: 22px;color: #444;text-align: center;\">\n\t<span style=\"font-size:18px;\">We’re having a Huge Stock Clearance for the End of July – and you’re invited!</span></h3>\n<span style=\"font-size:18px;\">Feast your eyes upon...</span><br>\n<ul>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\">5% Off EVERYTHING – With Coupon Code “CLEARANCE”</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/hp/ink-cartridges\">2 for £10 On Selected HP Refilled Ink</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/epson/ink-cartridges\">A Free Black With Every Epson Compatible Multipack</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/canon/ink-cartridges\">Select Canon Compatible Multipacks are Buy One Get One Free</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/brother/ink-cartridges\">Free Blacks with Select Brother Compatible Multipacks</a></span></p>\n\t</li>\n</ul>\n<br>\n<span style=\"font-size:18px;\">To Enjoy Your 5% Discount, Don't Forget to Enter the Coupon Code "CLEARANCE" in your basket before proceeding to the checkout!</span><br>\n<h3 style=\"font-size: 18px;font-family: 'arial rounded mt bold', arial, sans-serif;line-height: 22px;color: #444;text-align: center;\">\n\t<span style=\"font-size:18px;\">And Don’t Forget The Benefits of Shopping at Stinkyink</span></h3>\n<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t<span style=\"font-size:18px;\"><strong>Every Order</strong> Enjoys Free Delivery!<br>\n\t<strong>Every Item</strong> Enjoys a 6-month Guarantee!<br>\n\t<strong>Every Customer</strong> Enjoys a Free Pen with Their Order!<br>\n\t<br>\n\tCan’t wait and want to jump straight to your Product? <a href=\"http://www.stinkyinkshop.co.uk/\">Find Your Printer Now!</a></span></p>\n<div style=\"text-align: center;\">\n\t </div>\n<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t </p>\n<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\"><img alt=\"\" border=\"0\" height=\"96\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/startshopping_320_96.jpg\" width=\"320\" style=\"border: none;\"></a></span> <!-- RIGHT COLUMN --></div>\n <!-- FOOTER --> \n <div id=\"footer\" style=\"border: 1px solid #ccc;background-color: #eee;padding: 10px 0;text-align: center;margin: 50px auto 0 auto;width: 600px;\"> \n <p style=\"font-size: 11px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n *|IFNOT:ARCHIVE_PAGE|*\n *|LIST:DESCRIPTION|* <br>\n </p><p style=\"font-size: 11px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">*|HTML:LIST_ADDRESS_HTML|*</p>\n *|END:IF|*\n \n <p style=\"font-size: 11px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n <a href=\"*|UNSUB|*\">unsubscribe from this list</a> | <a href=\"*|UPDATE_PROFILE|*\">update subscription preferences</a>\n *|IFNOT:ARCHIVE_PAGE|*<br><a href=\"*|ARCHIVE|*\">view email in browser</a>*|END:IF|* \n </p>\n </div> \n </td>\n </tr>\n </table>\n </div>\n </center>\n </body>\n</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" style=\"background-color: #fff;padding: 0;margin: 0;\">\n <head>\n <meta property=\"og:title\" content=\"*|MC:SUBJECT|*\"> \n <title>*|MC:SUBJECT|*</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n \n <style type=\"text/css\">\n\t\thtml,body{\n\t\t\tbackground-color:#fff;\n\t\t\tpadding:0;\n\t\t\tmargin:0;\n\t\t}\n\t\t#wrapper{\n\t\t\twidth:600px;\n\t\t\tmargin:0px auto 20px auto;\n\t\t}\n\t\tbody{\n\t\t\tfont-size:13px;\n\t\t\tfont-family:arial, sans-serif;\n\t\t\tline-height:20px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:left;\n\t\t}\n\t\tp{\n\t\t\tfont-size:13px;\n\t\t\tfont-family:arial, sans-serif;\n\t\t\tline-height:20px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:center;\n\t\t}\n\t\th2,h3{\n\t\t\tfont-size:18px;\n\t\t\tfont-family:'arial rounded mt bold', arial, sans-serif;\n\t\t\tline-height:22px;\n\t\t\tcolor:#444;\n\t\t\ttext-align:center;\n\t\t}\n\t\ta img{\n\t\t\tborder:none;\n\t\t}\n\t\t#man img{\n\t\t\tmargin-bottom:5px;\n\t\t}\n\t\t#man{\n\t\t\tpadding-bottom:20px;\n\t\t}\n\t\t#footer{\n\t\t\tborder:1px solid #ccc;\n\t\t\tbackground-color:#eee;\n\t\t\tpadding:10px 0;\n\t\t\ttext-align:center;\n\t\t\tmargin:50px auto 0 auto;\n\t\t\twidth:600px;\n\t\t}\n\t\t#footer p{\n\t\t\ttext-align:center;\n\t\t\tfont-size:11px;\n\t\t}\n</style></head>\n <body style=\"text-align: center;background-color: #fff;padding: 0;margin: 0;font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;\">\n <center>\n <div id=\"wrapper\" style=\"width: 600px;margin: 0px auto 20px auto;\">\n <table width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td>\n <!-- CONTENT -->\n <div mc:edit=\"content\"><h3 style=\"font-size: 18px;font-family: 'arial rounded mt bold', arial, sans-serif;line-height: 22px;color: #444;text-align: center;\">\n\t<span style=\"font-size:18px;\">We’re having a Huge Stock Clearance for the End of July – and you’re invited!</span></h3>\n<span style=\"font-size:18px;\">Feast your eyes upon...</span><br>\n<ul>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\">5% Off EVERYTHING – With Coupon Code “CLEARANCE”</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/hp/ink-cartridges\">2 for £10 On Selected HP Refilled Ink</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/epson/ink-cartridges\">A Free Black With Every Epson Compatible Multipack</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/canon/ink-cartridges\">Select Canon Compatible Multipacks are Buy One Get One Free</a></span></p>\n\t</li>\n\t<li>\n\t\t<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t\t\t<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/brother/ink-cartridges\">Free Blacks with Select Brother Compatible Multipacks</a></span></p>\n\t</li>\n</ul>\n<br>\n<span style=\"font-size:18px;\">To Enjoy Your 5% Discount, Don't Forget to Enter the Coupon Code "CLEARANCE" in your basket before proceeding to the checkout!</span><br>\n<h3 style=\"font-size: 18px;font-family: 'arial rounded mt bold', arial, sans-serif;line-height: 22px;color: #444;text-align: center;\">\n\t<span style=\"font-size:18px;\">And Don’t Forget The Benefits of Shopping at Stinkyink</span></h3>\n<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t<span style=\"font-size:18px;\"><strong>Every Order</strong> Enjoys Free Delivery!<br>\n\t<strong>Every Item</strong> Enjoys a 6-month Guarantee!<br>\n\t<strong>Every Customer</strong> Enjoys a Free Pen with Their Order!<br>\n\t<br>\n\tCan’t wait and want to jump straight to your Product? <a href=\"http://www.stinkyinkshop.co.uk/\">Find Your Printer Now!</a></span></p>\n<div style=\"text-align: center;\">\n\t </div>\n<p style=\"font-size: 13px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n\t </p>\n<span style=\"font-size:18px;\"><a href=\"http://www.stinkyinkshop.co.uk/\"><img alt=\"\" border=\"0\" height=\"96\" src=\"http://gallery.mailchimp.com/d5dc05cb124ab4823186102fb/images/startshopping_320_96.jpg\" width=\"320\" style=\"border: none;\"></a></span> <!-- RIGHT COLUMN --></div>\n <!-- FOOTER --> \n <div id=\"footer\" mc:edit=\"footer\" style=\"border: 1px solid #ccc;background-color: #eee;padding: 10px 0;text-align: center;margin: 50px auto 0 auto;width: 600px;\"> \n <p style=\"font-size: 11px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n *|IFNOT:ARCHIVE_PAGE|*\n *|LIST:DESCRIPTION|* <br>\n </p><p style=\"font-size: 11px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">*|HTML:LIST_ADDRESS_HTML|*</p>\n *|END:IF|*\n \n <p style=\"font-size: 11px;font-family: arial, sans-serif;line-height: 20px;color: #444;text-align: center;\">\n <a href=\"*|UNSUB|*\">unsubscribe from this list</a> | <a href=\"*|UPDATE_PROFILE|*\">update subscription preferences</a>\n *|IFNOT:ARCHIVE_PAGE|*<br><a href=\"*|ARCHIVE|*\">view email in browser</a>*|END:IF|* \n </p>\n </div> \n </td>\n </tr>\n </table>\n </div>\n </center>\n </body>\n</html>
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chimp_contact
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Robert Williams
|
9
|
+
- Andrew Warburton
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2011-11-30 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
requirement: &70294933454180 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70294933454180
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rake
|
28
|
+
requirement: &70294933453760 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70294933453760
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: fakeweb
|
39
|
+
requirement: &70294933453340 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *70294933453340
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: nokogiri
|
50
|
+
requirement: &70294933452920 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70294933452920
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: hominid
|
61
|
+
requirement: &70294933452500 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
type: :runtime
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *70294933452500
|
70
|
+
description: Converts mailchimp templates to constant contact format but more verbose
|
71
|
+
email:
|
72
|
+
- rob@r-williams.com
|
73
|
+
- andy@warburton.me
|
74
|
+
executables: []
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- .gitignore
|
79
|
+
- Gemfile
|
80
|
+
- Rakefile
|
81
|
+
- chimp_contact.gemspec
|
82
|
+
- lib/chimp_contact.rb
|
83
|
+
- lib/chimp_contact/converter.rb
|
84
|
+
- lib/chimp_contact/template.rb
|
85
|
+
- lib/chimp_contact/version.rb
|
86
|
+
- spec/chimp_contact_spec.rb
|
87
|
+
- spec/fixtures/template.html
|
88
|
+
- spec/fixtures/template_with_inline_css.html
|
89
|
+
homepage: ''
|
90
|
+
licenses: []
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
hash: -4099253186804317150
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
hash: -4099253186804317150
|
113
|
+
requirements: []
|
114
|
+
rubyforge_project: chimp_contact
|
115
|
+
rubygems_version: 1.8.10
|
116
|
+
signing_key:
|
117
|
+
specification_version: 3
|
118
|
+
summary: Converts mailchimp templates to constant contact format
|
119
|
+
test_files:
|
120
|
+
- spec/chimp_contact_spec.rb
|
121
|
+
- spec/fixtures/template.html
|
122
|
+
- spec/fixtures/template_with_inline_css.html
|