Created
September 14, 2015 14:45
-
-
Save nvolungis/66a884a07555997b8d18 to your computer and use it in GitHub Desktop.
upload emails to dah newsletter via csv file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'uri' | |
require 'csv' | |
booth_endpoint = "http://wistia.com/newsletter/subscribe?campaign=events&form=inbound&email=" | |
party_endpoint = "http://wistia.com/newsletter/subscribe?campaign=events&form=inbound-party&email=" | |
def track_emails(file, endpoint) | |
count = 0 | |
CSV.foreach(file) do |row| | |
count += 1 | |
uri = URI.escape(endpoint + row[0]) | |
open(uri) do |f| | |
puts "#{count}, #{row[0]}, #{f.status}" | |
end | |
end | |
end | |
track_emails('emails-party.csv', party_endpoint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment