superficial cleanup

This commit is contained in:
Connor Olding 2020-08-30 12:19:42 +02:00
parent ca136b65a3
commit 484de18d46
2 changed files with 7 additions and 4 deletions

View file

@ -21,6 +21,7 @@ new = [
likely = [
# these checks are, in practice, the most likely
# to weed out unwanted DNS servers.
Check("news", "huanqiu.com"),
Check("adware", rot13("nqf789.pbz")),
@ -30,6 +31,7 @@ likely = [
# some servers block piracy and porn sites for being taboo, or whatever.
Check("porn", "pornhub.com"),
Check("adtrack", "media.fastclick.net"),
# dns.watch fails here: domain parking is evil, but servers must abide.

View file

@ -5,6 +5,10 @@ for a, b, c, d in zip("anAN05", "mzMZ49", "naNA50", "zmZM94"):
range(ord(c), ord(d) + 1))))
def rot13(s):
return "".join(rot13_mapping.get(c, c) for c in s)
def right_now():
from datetime import datetime, timezone
return datetime.now(timezone.utc)
@ -19,15 +23,12 @@ def nonsense_consistent(domain):
return "".join(rng.choice(ascii_lowercase) for i in range(length))
def rot13(s):
return "".join(rot13_mapping.get(c, c) for c in s)
def concat_nonsense(domain):
return nonsense_consistent(domain) + "." + domain
def head(n, it):
# TODO: maybe just do return [a for _, a in zip(range(n), it)]
res = []
try:
while len(res) < n: