"""Print, from the saved scan, what each organization named on rslcollective.org publishes on its main domains."""
import json

rows = {r["domain"]: r for r in json.load(open("results.json"))}
src = open("scan.py").read()
SUPPORTERS = eval(src.split("SUPPORTERS = ")[1].split("\n}\n")[0] + "\n}")

print(f"{'organization':<17}{'domain':<20}{'robots.txt':<16}License line")
for org, domains in SUPPORTERS.items():
    for d in domains:
        r = rows[d]
        status = r["robots_status"]
        robots = "readable" if status == 200 else f"HTTP {status} to me"
        lic = "yes" if r["license_lines"] else ("-" if status != 200 else "no")
        print(f"{org:<17}{d:<20}{robots:<16}{lic}")
