Skip to content

Commit

Permalink
polls correct data and has it in text
Browse files Browse the repository at this point in the history
  • Loading branch information
altf4arnold committed Feb 12, 2024
1 parent 05ca06b commit 963616f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tldtester/sorter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""
This file is dumping the IANA root zone and sorting it in the database
Link to IANA website : https://www.internic.net/domain/root.zone
"""
import urllib.request


def downloader():
"""
Downloads the data. Returns None if not working, Returns data if working
"""
url = urllib.request.urlopen("https://www.internic.net/domain/root.zone")
if url.getcode() == 200:
raw = url.read()
raw = raw.decode("utf-8")
else:
raw = None
return raw


def sorter(rawdata):
"""
This file removes the tabs and line breaks from rawdata
returns as a list with dictionary in it
"""
print(str(rawdata))


def main():
try:
sorter(downloader())
except Exception as e:
print(e)


if __name__ == '__main__':
main()

0 comments on commit 963616f

Please sign in to comment.