moocher 0.1.1.4pre → 0.1.1.5pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -1
- data/lib/moocher/emails.rb +20 -0
- data/lib/moocher/version.rb +1 -1
- data/lib/moocher.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381af536807a25d92983724a44b66199c281d630
|
4
|
+
data.tar.gz: abb01ec5ae70b2db371cd24e2ca3a494c33ae607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef75922c190efc44cca8bbecc83dc47979b856e7c65ca83d7ac17bc87c61203309ad66353cb2844e254f7e226635b86c99468a91865bd800c9c55046d9ed7df4
|
7
|
+
data.tar.gz: d437cca0959d3939748b896fa51624b9c4773436080e1de643f0bb7c80e0f16e804f816c5e36e3f2f695d9f49ef82369bf8a0593fa5f0349b8bf003b2624d2d3
|
data/README.md
CHANGED
@@ -24,7 +24,28 @@ require 'moocher'
|
|
24
24
|
domain_blacklisted? "google.com"
|
25
25
|
#=> false
|
26
26
|
|
27
|
-
domain_blacklisted? "google.com", details: true #Swithing details to true will give you detailed response on domain
|
27
|
+
domain_blacklisted? "google.com", details: true #Swithing details to true will give you detailed response on domain
|
28
28
|
|
29
29
|
#=> {"response"=>{"source_ip"=>{"geo"=>{}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}, "domain"=>{"mx"=>["aspmx.l.google.com", "alt3.aspmx.l.google.com", "alt4.aspmx.l.google.com", "alt2.aspmx.l.google.com", "alt1.aspmx.l.google.com"], "blacklist"=>[], "ns"=>["ns1.google.com.", "ns3.google.com.", "ns2.google.com.", "ns4.google.com."], "score"=>0, "blacklist_mx"=>[], "blacklist_ns"=>[]}, "score"=>0, "ip"=>{"geo"=>{"hostname"=>"", "address"=>"216.58.214.174", "longitude"=>-122.0574, "region"=>"California", "country"=>"US", "as"=>{"asn"=>"15169", "country"=>"US", "networks"=>"['8.8.4.0/24', '8.8.8.0/24', '8.34.208.0/21', '8.34.216.0/21', '8.35.192.0/21', '8.35.200.0/21', '23.236.48.0/20', '23.251.128.0/19', '35.184.0.0/13', '64.233.160.0/19', '64.233.160.0/24', '64.233.161.0/24', '64.233.162.0/24', '64.233.163.0/24', '64.233.164.0/24', '64.233.165.0/24', '64.233.166.0/24', '64.233.167.0/24', '64.233.168.0/24', '64.233.169.0/24', '64.233.171.0/24', '64.233.176.0/24', '64.233.177.0/24', '64.233.178.0/24', '64.233.179.0/24', '64.233.180.0/24', '64.233.181.0/24', '64.233.182.0/24', '64.233.183.0/24', '64.233.184.0/24', '64.233.185.0/24', '64.233.186.0/24', '64.233.187.0/24', '64.233.188.0/24', '64.233.189.0/24', '64.233.190.0/24', '64.233.191.0/24', '66.102.0.0/20', '66.102.1.0/24', '66.102.2.0/24', '66.102.3.0/24', '66.102.4.0/24', '66.102.12.0/24', '66.249.64.0/19', '70.32.128.0/19', '70.32.131.0/24', '70.32.145.0/24', '70.32.146.0/23', '70.32.151.0/24', '72.14.192.0/18', '74.114.24.0/21', '74.125.0.0/16', '74.125.0.0/18', '74.125.6.0/24', '74.125.21.0/24', '74.125.22.0/24', '74.125.23.0/24', '74.125.26.0/24', '74.125.27.0/24', '74.125.28.0/24', '74.125.29.0/24', '74.125.30.0/24', '74.125.31.0/24', '74.125.39.0/24', '74.125.68.0/24', '74.125.69.0/24', '74.125.70.0/24', '74.125.71.0/24', '74.125.126.0/24', '74.125.127.0/24', '74.125.128.0/24', '74.125.129.0/24', '74.125.130.0/24', '74.125.131.0/24', '74.125.132.0/24', '74.125.133.0/24', '74.125.134.0/24', '74.125.135.0/24', '74.125.138.0/24', '74.125.139.0/24', '74.125.140.0/24', '74.125.141.0/24', '74.125.142.0/24', '74.125.143.0/24', '74.125.192.0/24', '74.125.193.0/24', '74.125.195.0/24', '74.125.196.0/24', '74.125.198.0/24', '74.125.199.0/24', '74.125.200.0/24', '74.125.201.0/24', '74.125.202.0/24', '74.125.203.0/24', '74.125.204.0/24', '74.125.205.0/24', '74.125.206.0/24', '74.125.225.0/24', '74.125.226.0/24', '74.125.227.0/24', '74.125.228.0/24', '74.125.230.0/24', '74.125.232.0/24', '74.125.234.0/24', '74.125.235.0/24', '74.125.236.0/24', '74.125.238.0/24', '104.132.0.0/23', '104.132.5.0/24', '104.132.7.0/24', '104.132.8.0/24', '104.132.11.0/24', '104.132.34.0/24', '104.132.51.0/24', '104.132.141.0/24', '104.133.0.0/24', '104.133.2.0/23', '104.154.0.0/15', '104.196.0.0/14', '107.167.160.0/19', '107.178.192.0/18', '108.59.80.0/20', '108.170.192.0/18', '108.177.0.0/17', '108.177.8.0/24', '108.177.9.0/24', '108.177.10.0/24', '108.177.11.0/24', '108.177.12.0/24', '108.177.14.0/24', '108.177.15.0/24', '108.177.96.0/24', '108.177.97.0/24', '108.177.98.0/24', '130.211.0.0/16', '142.250.0.0/15', '146.148.0.0/17', '162.216.148.0/22', '162.222.176.0/21', '172.102.8.0/21', '172.102.8.0/24', '172.102.9.0/24', '172.102.10.0/24', '172.102.11.0/24', '172.102.12.0/23', '172.102.14.0/23', '172.110.32.0/21', '172.217.0.0/16', '172.217.0.0/24', '172.217.16.0/24', '172.217.24.0/24', '172.217.28.0/24', '172.217.30.0/24', '172.253.0.0/16', '173.194.0.0/16', '173.194.7.0/24', '173.194.32.0/24', '173.194.34.0/24', '173.194.35.0/24', '173.194.36.0/24', '173.194.37.0/24', '173.194.38.0/24', '173.194.39.0/24', '173.194.40.0/24', '173.194.41.0/24', '173.194.42.0/24', '173.194.44.0/24', '173.194.46.0/24', '173.194.53.0/24', '173.194.63.0/24', '173.194.64.0/24', '173.194.66.0/24', '173.194.67.0/24', '173.194.68.0/24', '173.194.69.0/24', '173.194.70.0/24', '173.194.73.0/24', '173.194.74.0/24', '173.194.76.0/24', '173.194.77.0/24', '173.194.78.0/24', '173.194.79.0/24', '173.194.112.0/24', '173.194.113.0/24', '173.194.117.0/24', '173.194.118.0/24', '173.194.119.0/24', '173.194.120.0/24', '173.194.121.0/24', '173.194.124.0/24', '173.194.132.0/24', '173.194.136.0/24', '173.194.140.0/24', '173.194.141.0/24', '173.194.142.0/24', '173.194.175.0/24', '173.194.192.0/24', '173.194.193.0/24', '173.194.194.0/24', '173.194.195.0/24', '173.194.196.0/24', '173.194.197.0/24', '173.194.198.0/24', '173.194.199.0/24', '173.194.200.0/24', '173.194.201.0/24', '173.194.202.0/24', '173.194.203.0/24', '173.194.204.0/24', '173.194.205.0/24', '173.194.206.0/24', '173.194.207.0/24', '173.194.208.0/24', '173.194.209.0/24', '173.194.210.0/24', '173.194.211.0/24', '173.194.212.0/24', '173.194.213.0/24', '173.194.214.0/24', '173.194.215.0/24', '173.194.216.0/24', '173.194.217.0/24', '173.194.218.0/24', '173.194.219.0/24', '173.194.220.0/24', '173.194.221.0/24', '173.194.222.0/24', '173.194.223.0/24', '173.255.112.0/20', '185.25.28.0/23', '185.150.148.0/22', '192.104.160.0/23', '192.158.28.0/22', '192.178.0.0/15', '199.192.112.0/22', '199.223.232.0/21', '207.223.160.0/20', '208.68.108.0/22', '208.81.188.0/22', '209.85.128.0/17', '209.85.144.0/24', '209.85.145.0/24', '209.85.147.0/24', '209.85.200.0/24', '209.85.201.0/24', '209.85.202.0/24', '209.85.203.0/24', '209.85.232.0/24', '209.85.233.0/24', '209.85.234.0/24', '209.85.235.0/24', '209.107.176.0/20', '209.107.176.0/23', '209.107.182.0/23', '216.58.192.0/19', '216.58.200.0/24', '216.58.208.0/24', '216.58.209.0/24', '216.58.210.0/24', '216.58.211.0/24', '216.58.212.0/24', '216.58.213.0/24', '216.58.214.0/24', '216.58.215.0/24', '216.58.216.0/24', '216.58.217.0/24', '216.58.218.0/24', '216.58.219.0/24', '216.58.220.0/24', '216.58.221.0/24', '216.58.222.0/24', '216.58.223.0/24', '216.73.80.0/20', '216.239.32.0/19', '216.239.32.0/24', '216.239.33.0/24', '216.239.34.0/24', '216.239.35.0/24', '216.239.36.0/24', '216.239.38.0/24', '216.239.39.0/24', '216.252.220.0/22', '216.252.220.0/24', '216.252.221.0/24', '216.252.222.0/24']", "name"=>"GOOGLE - Google Inc."}, "city"=>"Mountain View", "continent"=>"NA", "postal"=>"94043", "latitude"=>37.419200000000004}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}}, "type"=>"baddomain"}
|
30
30
|
```
|
31
|
+
|
32
|
+
## Check Blacklisted Emails
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
require 'moocher'
|
36
|
+
|
37
|
+
email_blacklisted? "goodemail@gmail.com"
|
38
|
+
#=> false
|
39
|
+
|
40
|
+
email_blacklisted? "goodemail@gmail.com", details: true
|
41
|
+
|
42
|
+
#=> {"response"=>{"address"=>{"score"=>0, "is_well_formed"=>true, "is_role"=>false}, "domain"=>{"mx"=>["alt1.gmail-smtp-in.l.google.com", "alt3.gmail-smtp-in.l.google.com", "alt4.gmail-smtp-in.l.google.com", "alt2.gmail-smtp-in.l.google.com", "gmail-smtp-in.l.google.com"], "blacklist"=>["FREEMAIL"], "ns"=>["ns2.google.com.", "ns3.google.com.", "ns1.google.com.", "ns4.google.com."], "score"=>-1, "blacklist_mx"=>[], "blacklist_ns"=>[]}, "email"=>{"score"=>0, "blacklist"=>[]}, "ip"=>{"geo"=>{"hostname"=>"", "address"=>"216.58.214.165", "longitude"=>-122.0574, "region"=>"California", "country"=>"US", "as"=>{"asn"=>"15169", "country"=>"US", "networks"=>"['8.8.4.0/24', '8.8.8.0/24', '8.34.208.0/21', '8.34.216.0/21', '8.35.192.0/21', '8.35.200.0/21', '23.236.48.0/20', '23.251.128.0/19', '35.184.0.0/13', '64.233.160.0/19', '64.233.160.0/24', '64.233.161.0/24', '64.233.162.0/24', '64.233.163.0/24', '64.233.164.0/24', '64.233.165.0/24', '64.233.166.0/24', '64.233.167.0/24', '64.233.168.0/24', '64.233.169.0/24', '64.233.171.0/24', '64.233.176.0/24', '64.233.177.0/24', '64.233.178.0/24', '64.233.179.0/24', '64.233.180.0/24', '64.233.181.0/24', '64.233.182.0/24', '64.233.183.0/24', '64.233.184.0/24', '64.233.185.0/24', '64.233.186.0/24', '64.233.187.0/24', '64.233.188.0/24', '64.233.189.0/24', '64.233.190.0/24', '64.233.191.0/24', '66.102.0.0/20', '66.102.1.0/24', '66.102.2.0/24', '66.102.3.0/24', '66.102.4.0/24', '66.102.12.0/24', '66.249.64.0/19', '70.32.128.0/19', '70.32.131.0/24', '70.32.145.0/24', '70.32.146.0/23', '70.32.151.0/24', '72.14.192.0/18', '74.114.24.0/21', '74.125.0.0/16', '74.125.0.0/18', '74.125.6.0/24', '74.125.21.0/24', '74.125.22.0/24', '74.125.23.0/24', '74.125.26.0/24', '74.125.27.0/24', '74.125.28.0/24', '74.125.29.0/24', '74.125.30.0/24', '74.125.31.0/24', '74.125.39.0/24', '74.125.68.0/24', '74.125.69.0/24', '74.125.70.0/24', '74.125.71.0/24', '74.125.126.0/24', '74.125.127.0/24', '74.125.128.0/24', '74.125.129.0/24', '74.125.130.0/24', '74.125.131.0/24', '74.125.132.0/24', '74.125.133.0/24', '74.125.134.0/24', '74.125.135.0/24', '74.125.138.0/24', '74.125.139.0/24', '74.125.140.0/24', '74.125.141.0/24', '74.125.142.0/24', '74.125.143.0/24', '74.125.192.0/24', '74.125.193.0/24', '74.125.195.0/24', '74.125.196.0/24', '74.125.198.0/24', '74.125.199.0/24', '74.125.200.0/24', '74.125.201.0/24', '74.125.202.0/24', '74.125.203.0/24', '74.125.204.0/24', '74.125.205.0/24', '74.125.206.0/24', '74.125.225.0/24', '74.125.226.0/24', '74.125.227.0/24', '74.125.228.0/24', '74.125.230.0/24', '74.125.232.0/24', '74.125.234.0/24', '74.125.235.0/24', '74.125.236.0/24', '74.125.238.0/24', '104.132.0.0/23', '104.132.5.0/24', '104.132.7.0/24', '104.132.8.0/24', '104.132.11.0/24', '104.132.34.0/24', '104.132.51.0/24', '104.132.141.0/24', '104.133.0.0/24', '104.133.2.0/23', '104.154.0.0/15', '104.196.0.0/14', '107.167.160.0/19', '107.178.192.0/18', '108.59.80.0/20', '108.170.192.0/18', '108.177.0.0/17', '108.177.8.0/24', '108.177.9.0/24', '108.177.10.0/24', '108.177.11.0/24', '108.177.12.0/24', '108.177.14.0/24', '108.177.15.0/24', '108.177.96.0/24', '108.177.97.0/24', '108.177.98.0/24', '130.211.0.0/16', '142.250.0.0/15', '146.148.0.0/17', '162.216.148.0/22', '162.222.176.0/21', '172.102.8.0/21', '172.102.8.0/24', '172.102.9.0/24', '172.102.10.0/24', '172.102.11.0/24', '172.102.12.0/23', '172.102.14.0/23', '172.110.32.0/21', '172.217.0.0/16', '172.217.0.0/24', '172.217.16.0/24', '172.217.24.0/24', '172.217.28.0/24', '172.217.30.0/24', '172.253.0.0/16', '173.194.0.0/16', '173.194.7.0/24', '173.194.32.0/24', '173.194.34.0/24', '173.194.35.0/24', '173.194.36.0/24', '173.194.37.0/24', '173.194.38.0/24', '173.194.39.0/24', '173.194.40.0/24', '173.194.41.0/24', '173.194.42.0/24', '173.194.44.0/24', '173.194.46.0/24', '173.194.53.0/24', '173.194.63.0/24', '173.194.64.0/24', '173.194.66.0/24', '173.194.67.0/24', '173.194.68.0/24', '173.194.69.0/24', '173.194.70.0/24', '173.194.73.0/24', '173.194.74.0/24', '173.194.76.0/24', '173.194.77.0/24', '173.194.78.0/24', '173.194.79.0/24', '173.194.112.0/24', '173.194.113.0/24', '173.194.117.0/24', '173.194.118.0/24', '173.194.119.0/24', '173.194.120.0/24', '173.194.121.0/24', '173.194.124.0/24', '173.194.132.0/24', '173.194.136.0/24', '173.194.140.0/24', '173.194.141.0/24', '173.194.142.0/24', '173.194.175.0/24', '173.194.192.0/24', '173.194.193.0/24', '173.194.194.0/24', '173.194.195.0/24', '173.194.196.0/24', '173.194.197.0/24', '173.194.198.0/24', '173.194.199.0/24', '173.194.200.0/24', '173.194.201.0/24', '173.194.202.0/24', '173.194.203.0/24', '173.194.204.0/24', '173.194.205.0/24', '173.194.206.0/24', '173.194.207.0/24', '173.194.208.0/24', '173.194.209.0/24', '173.194.210.0/24', '173.194.211.0/24', '173.194.212.0/24', '173.194.213.0/24', '173.194.214.0/24', '173.194.215.0/24', '173.194.216.0/24', '173.194.217.0/24', '173.194.218.0/24', '173.194.219.0/24', '173.194.220.0/24', '173.194.221.0/24', '173.194.222.0/24', '173.194.223.0/24', '173.255.112.0/20', '185.25.28.0/23', '185.150.148.0/22', '192.104.160.0/23', '192.158.28.0/22', '192.178.0.0/15', '199.192.112.0/22', '199.223.232.0/21', '207.223.160.0/20', '208.68.108.0/22', '208.81.188.0/22', '209.85.128.0/17', '209.85.144.0/24', '209.85.145.0/24', '209.85.147.0/24', '209.85.200.0/24', '209.85.201.0/24', '209.85.202.0/24', '209.85.203.0/24', '209.85.232.0/24', '209.85.233.0/24', '209.85.234.0/24', '209.85.235.0/24', '209.107.176.0/20', '209.107.176.0/23', '209.107.182.0/23', '216.58.192.0/19', '216.58.200.0/24', '216.58.208.0/24', '216.58.209.0/24', '216.58.210.0/24', '216.58.211.0/24', '216.58.212.0/24', '216.58.213.0/24', '216.58.214.0/24', '216.58.215.0/24', '216.58.216.0/24', '216.58.217.0/24', '216.58.218.0/24', '216.58.219.0/24', '216.58.220.0/24', '216.58.221.0/24', '216.58.222.0/24', '216.58.223.0/24', '216.73.80.0/20', '216.239.32.0/19', '216.239.32.0/24', '216.239.33.0/24', '216.239.34.0/24', '216.239.35.0/24', '216.239.36.0/24', '216.239.38.0/24', '216.239.39.0/24', '216.252.220.0/22', '216.252.220.0/24', '216.252.221.0/24', '216.252.222.0/24']", "name"=>"GOOGLE - Google Inc."}, "city"=>"Mountain View", "continent"=>"NA", "postal"=>"94043", "latitude"=>37.419200000000004}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}, "score"=>0, "disposable"=>{"is_disposable"=>false, "score"=>0}, "source_ip"=>{"geo"=>{}, "score"=>0, "is_quarantined"=>false, "blacklist"=>[]}, "smtp"=>{"exist_catchall"=>false, "score"=>1, "exist_address"=>true, "exist_mx"=>true}, "freemail"=>{"score"=>0, "is_freemail"=>true}}, "type"=>"bademail"}
|
43
|
+
|
44
|
+
```
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
email_blacklisted? "goodmail@gmail.com"
|
48
|
+
#also returns freemail hash like below which is type bademail even though the email was not found in any blacklist database
|
49
|
+
|
50
|
+
#"freemail"=>{"score"=>0, "is_freemail"=>true}}, "type"=>"bademail"}
|
51
|
+
```
|
data/lib/moocher/emails.rb
CHANGED
@@ -1,2 +1,22 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
|
1
4
|
module Moocher
|
5
|
+
module Email
|
6
|
+
def email_blacklisted?(email, details: false)
|
7
|
+
return "Email doesn't seem to be valid." if (email =~ /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i).nil?
|
8
|
+
base_url = 'https://api.moocher.io/bademail/'
|
9
|
+
unless details
|
10
|
+
response = HTTParty.get(base_url + email)
|
11
|
+
(response["response"]["email"]["blacklist"].empty? && response["response"]["source_ip"]["blacklist"].empty?) ? false : true
|
12
|
+
else
|
13
|
+
if details == true
|
14
|
+
response = HTTParty.get("https://api.moocher.io/bademail/#{email}", headers: {"Content-Type": "application/json"})
|
15
|
+
return response.parsed_response
|
16
|
+
else
|
17
|
+
"'details:' is by default set to false. You can only be set it to true."
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
2
22
|
end
|
data/lib/moocher/version.rb
CHANGED
data/lib/moocher.rb
CHANGED