Sha256: dfe89f0543528bddda1050aeb50dcdb78d67f52e3439de0cfb5b66b801ad6f0c

Contents?: true

Size: 730 Bytes

Versions: 4

Compression:

Stored size: 730 Bytes

Contents

#!/usr/bin/env ruby

require "yaml"

require "json"
require "net/http"

whitelisted_emails = %w(
  onet.pl poczta.onet.pl fastmail.fm hushmail.com
  hush.ai hush.com hushmail.me naver.com qq.com example.com
  yandex.net gmx.com gmx.es webdesignspecialist.com.au vp.com
)

existing_emails = File.open("config/disposable_email_domains.txt") { |f| f.read.split("\n") }

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

remote_emails = resp.body.split("\n").flatten - whitelisted_emails

result_emails = (existing_emails + remote_emails).map(&:strip).uniq.sort

File.open("config/disposable_email_domains.txt", "w") {|f| f.write result_emails.join("\n") }

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
valid_email2-4.0.0 pull_mailchecker_emails.rb
valid_email2-3.7.0 pull_mailchecker_emails.rb
valid_email2-3.6.1 pull_mailchecker_emails.rb
valid_email2-3.6.0 pull_mailchecker_emails.rb