PwnedCheck passed 1000 downloads!

I’m so excited. My first experiment with creating and publishing a ruby gem seems to have been successful! As of this post it’s been downloaded 1069 times in the past 4 days. PwnedCheck is a ruby gem that I wrote that checks an email address against the new site by Troy Hunt called haveibeenpwned.com. His site aggregates password dumps from breaches and allows you to check to see if your password has been compromised. Use it as follows-

Installation

gem install PwnedCheck

Usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

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.eachdo|address|begin
sites = PwnedCheck::check(address)if sites.length == 0puts"#{address} --> Not found on http://haveibeenpwned.com"else
sites.eachdo|site|puts"#{address} --> #{site}"endendrescuePwnedCheck::InvalidEmail=> e
puts"#{address} --> #{e.message}"endend