PwnedCheck 1.0.16 → 1.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +10 -9
- data/lib/pwnedcheck.rb +3 -3
- data.tar.gz.sig +0 -0
- metadata +5 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd90f3cf67c2edf0f17225b969a9f4f17da4f0b9
|
4
|
+
data.tar.gz: 047f31643986c2b005ded0d7042aa8a51efa9ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41bfa9c815990e718abccfcc2c867cb109c0834f4b77dfe6a049673d551f4ccb119b9672cd3263ed3caf918d05fa604dfcbd3744303e83b6cdda2850cdb82549
|
7
|
+
data.tar.gz: 86768c421f68f6d6f390e9fdeb0857f90b57a06ac1e079a5506bae38fab27ddecf49b70f3d89bf47b55e83923f461f4044a7bb31dd33c60acabe38258d36eca4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Ruby gem to check to see if an email address is on http://haveibeenpwned.com
|
|
5
5
|
<table>
|
6
6
|
<tr>
|
7
7
|
<th>Version</th>
|
8
|
-
<td>1.0.
|
8
|
+
<td>1.0.17</td>
|
9
9
|
</tr>
|
10
10
|
<tr>
|
11
11
|
<th>Author</th>
|
@@ -31,24 +31,25 @@ gem install PwnedCheck
|
|
31
31
|
`````ruby
|
32
32
|
require 'pwnedcheck'
|
33
33
|
|
34
|
-
# The
|
34
|
+
# The 4 cases.
|
35
35
|
# foo@bar.com is a valid address on the site
|
36
36
|
# foo232323ce23ewd@bar.com is a valid address, but not on the site
|
37
37
|
# foo.bar.com is an invalid format
|
38
|
-
|
38
|
+
# mralexgray is a user id in snapchat
|
39
|
+
list = ['foo@bar.com', 'foo232323ce23ewd@bar.com', 'foo.bar.com', 'mralexgray']
|
39
40
|
|
40
|
-
|
41
|
+
list.each do |item|
|
41
42
|
begin
|
42
|
-
sites = PwnedCheck::check(
|
43
|
+
sites = PwnedCheck::check(item)
|
43
44
|
if sites.length == 0
|
44
|
-
puts "#{
|
45
|
+
puts "#{item} --> Not found on http://haveibeenpwned.com"
|
45
46
|
else
|
46
47
|
sites.each do |site|
|
47
|
-
puts "#{
|
48
|
+
puts "#{item} --> #{site}"
|
48
49
|
end
|
49
50
|
end
|
50
51
|
rescue PwnedCheck::InvalidEmail => e
|
51
|
-
puts "#{
|
52
|
+
puts "#{item} --> #{e.message}"
|
52
53
|
end
|
53
54
|
end
|
54
|
-
|
55
|
+
````
|
data/lib/pwnedcheck.rb
CHANGED
@@ -36,10 +36,10 @@ module PwnedCheck
|
|
36
36
|
|
37
37
|
# Check an address against http://haveibeenpwned.com
|
38
38
|
#
|
39
|
-
# @param
|
39
|
+
# @param item [String] the item to check. Could be an email address, phone number, or username
|
40
40
|
# @return [Array] an array of sites that the email address is associated with
|
41
|
-
def self.check(
|
42
|
-
uri = URI.parse "https://haveibeenpwned.com/api/breachedaccount/#{CGI::escape(
|
41
|
+
def self.check(item)
|
42
|
+
uri = URI.parse "https://haveibeenpwned.com/api/breachedaccount/#{CGI::escape(item)}"
|
43
43
|
response = Net::HTTP.get_response uri
|
44
44
|
case response.code
|
45
45
|
when '200'
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: PwnedCheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Sampson
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
mXk/ua0vocjxrv8hsEJFxUwf8cS3lTSPbKkeDknZtDz8pREiC8H0axttY2cmtWb1
|
30
30
|
QpRFRIGkUba0uOnrpDYGuuDffqcLmyWY2QNiM6h/V43zrVhJ
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2014-01-02 00:00:00.000000000 Z
|
33
33
|
dependencies: []
|
34
34
|
description: Checks an email address against haveibeenpwned.com.
|
35
35
|
email: chs@chs.us
|
@@ -40,10 +40,10 @@ extra_rdoc_files:
|
|
40
40
|
- AUTHOR.md
|
41
41
|
- LICENSE.md
|
42
42
|
files:
|
43
|
-
- lib/pwnedcheck.rb
|
44
|
-
- README.md
|
45
43
|
- AUTHOR.md
|
46
44
|
- LICENSE.md
|
45
|
+
- README.md
|
46
|
+
- lib/pwnedcheck.rb
|
47
47
|
homepage: http://www.chs.us/PwnedCheck
|
48
48
|
licenses:
|
49
49
|
- MIT
|
@@ -65,9 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
67
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.1
|
68
|
+
rubygems_version: 2.2.0.rc.1
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: Checks an email address against haveibeenpwned.com.
|
72
72
|
test_files: []
|
73
|
-
has_rdoc: yard
|
metadata.gz.sig
CHANGED
Binary file
|