Skip to content

Commit

Permalink
Add script that pulls disposable domains from https://raw.githubuserc…
Browse files Browse the repository at this point in the history
  • Loading branch information
nfedyashev committed Sep 27, 2015
1 parent 9f8890a commit 7a34878
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pull_mailchecker_emails.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'pry'

require 'yaml'

require 'json'
require 'net/http'

existing_emails = YAML.load_file('vendor/disposable_emails.yml')

url = 'https://raw.githubusercontent.com/FGRibreau/mailchecker/master/list.json'
resp = Net::HTTP.get_response(URI.parse(url))

remote_emails = JSON.parse(resp.body).flatten

result_emails = (existing_emails + remote_emails).collect { |email| email.gsub(' ', '') }.uniq.sort

File.open('vendor/new_disposable_emails.yml', 'w') {|f| f.write result_emails.to_yaml }

0 comments on commit 7a34878

Please sign in to comment.