Skip to content

Instantly share code, notes, and snippets.

@nvolungis
Created September 14, 2015 14:45
Show Gist options
  • Save nvolungis/66a884a07555997b8d18 to your computer and use it in GitHub Desktop.
Save nvolungis/66a884a07555997b8d18 to your computer and use it in GitHub Desktop.
upload emails to dah newsletter via csv file
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