PwnedCheck

Ruby gem to check to see if an email address, phone number, or username is on haveibeenpwned.com

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

Installation

ruby gem install PwnedCheck

Usage

““`ruby require 'pwnedcheck'

The 4 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

mralexgray is a user id in snapchat

list = ['foo@bar.com', 'foo232323ce23ewd@bar.com', 'foo.bar.com', 'mralexgray']

list.each do |item| begin sites = PwnedCheck::check(item) if sites.length == 0 puts “#{item} –> Not found on haveibeenpwned.com” else sites.each do |site| site is a hash of data returned puts item puts “tTitle=#{site}” puts “tBreach Date=#{site}” puts “tDescription=#{site}” end end rescue PwnedCheck::InvalidEmail => e puts “#{item} –> #{e.message}” end end ““

““`ruby require 'pwnedcheck'

The 4 cases to check for pastes.

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

mralexgray is a user id in snapchat

list = ['foo@bar.com', 'foo232323ce23ewd@bar.com', 'foo.bar.com', 'mralexgray']

list.each do |item| begin sites = PwnedCheck::check_pastes(item) if sites.length == 0 puts “#{item} –> Not found on haveibeenpwned.com” else sites.each do |site| site is a hash of data returned puts item puts “tSource=#{site}” puts “tTitle=#{site}” puts “tDate=#{site}” puts “tEmail Count=#{site}” end end rescue PwnedCheck::InvalidEmail => e puts “#{item} –> #{e.message}” end end ““