Sha256: 7497c6eebd95aae8dc9067ab2c48a4e9dc174f1ed7191a63e4990e0a33a2a593

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

#!/usr/bin/env ruby

require "yaml"

require "json"
require "net/http"

whitelisted_domains = %w(poczta.onet.pl fastmail.fm hushmail.com naver.com)

existing_domains = File.readlines("vendor/disposable_domains.txt")

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

remote_domains = JSON.parse(resp.body).flatten - whitelisted_domains

puts "New domains found: #{(remote_domains - existing_domains).join(', ')}"

result_domains = (existing_domains + remote_domains).map { |domain| domain.strip.downcase }.uniq.sort

File.open("vendor/disposable_domains.txt", "w") { |f| f.write result_domains.join("\n") }

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
email_assessor-0.1 pull_mailchecker_emails.rb