Skip to content

Instantly share code, notes, and snippets.

/fullcontact.rb Secret

Created December 24, 2015 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9a730323a7d8be8a41ce to your computer and use it in GitHub Desktop.
Save anonymous/9a730323a7d8be8a41ce to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'json'
api_key = '#'
emails = IO.readlines("customers.md")
f = File.open('customers.json', 'w')
list = []
emails.each do |email|
email.chomp!
begin
response = open("http://api.fullcontact.com/v2/person.json?email=#{email}&apiKey=#{api_key}").read
list << response
rescue => e
puts e.message
end
end
f.write("[#{response.join(', ')}]")
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment