mirror of
https://github.com/disposable-email-domains/disposable-email-domains.git
synced 2024-11-22 00:28:12 +08:00
add check for public suffix
This commit is contained in:
parent
8131c18655
commit
4f21e5c8a1
6
.travis.yml
Normal file
6
.travis.yml
Normal file
@ -0,0 +1,6 @@
|
||||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
script:
|
||||
- python verify.py
|
||||
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
publicsuffixlist
|
19
verify.py
Normal file
19
verify.py
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""Verify the integrity of the domain blacklist
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from publicsuffixlist import PublicSuffixList
|
||||
|
||||
def main(arguments):
|
||||
psl = PublicSuffixList()
|
||||
with open("disposable_email_blacklist", "r") as deb:
|
||||
for line in deb:
|
||||
if psl.publicsuffix(line) != line:
|
||||
print(f'The following line is a public suffix: {line} - please remove it from the blacklist file. See https://publicsuffix.org for details.')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
Loading…
Reference in New Issue
Block a user