drakeshs / PwnedCheck

Ruby gem to check to see if an email address is on http://haveibeenpwned.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PwnedCheck

Ruby gem to check to see if an email address is on http://haveibeenpwned.com

Version 1.0.15
Author Carl Sampson (@chs)
Page http://www.chs.us/PwnedCheck
Github http://github.com/sampsonc/PwnedCheck

Installation

gem install PwnedCheck

Usage

require 'pwnedcheck'

# The 3 cases.
# foo@bar.com is a valid address on the site
# foo232323ce23ewd@bar.com is a valid address, but not on the site
# foo.bar.com is an invalid format
addresses = ['foo@bar.com', 'foo232323ce23ewd@bar.com', 'foo.bar.com']

addresses.each do |address|
  begin
    sites = PwnedCheck::check(address)
    if sites.length == 0
      puts "#{address} --> Not found on http://haveibeenpwned.com"
    else
      sites.each do |site|
        puts "#{address} --> #{site}"
      end
    end
  rescue PwnedCheck::InvalidEmail => e
    puts "#{address} --> #{e.message}"
  end
end

Real Time Web Analytics

<script src="//static.getclicky.com/js" type="text/javascript"></script> <script type="text/javascript">try{ clicky.init(100685763); }catch(e){}</script>

Clicky

About

Ruby gem to check to see if an email address is on http://haveibeenpwned.com

License:MIT License