Skip to content

Commit

Permalink
Merge pull request #33 from nfedyashev/add_script_for_pulling_more_do…
Browse files Browse the repository at this point in the history
…mains

Add script that pulls disposable domains
  • Loading branch information
micke committed Sep 28, 2015
2 parents 3d81a38 + 4dcc9d7 commit 41020db
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).map(&:strip).uniq.sort

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

0 comments on commit 41020db

Please sign in to comment.