"wikilinks"
]
- domains = {
+ blocklist = {
"silenced": list(),
"reject" : list(),
}
silenced = doc.find("h2", {"id": "silenced-instances"}).findNext("table").find("tbody")
logger.debug("silenced[%s]()=%d", type(silenced), len(silenced))
- domains["silenced"] = federation.find_domains(silenced)
+ blocklist["silenced"] = federation.find_domains(silenced)
blocked = doc.find("h2", {"id": "blocked-instances"}).findNext("table").find("tbody")
logger.debug("blocked[%s]()=%d", type(blocked), len(blocked))
- domains["reject"] = federation.find_domains(blocked)
+ blocklist["reject"] = federation.find_domains(blocked)
blocking = blocklist["silenced"] + blocklist["reject"]
blocker = "chaos.social"
logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", blocker, len(blocking))
instances.set_total_blocks(blocker, blocking)
- logger.debug("domains[silenced]()=%d,domains[reject]()=%d", len(domains["silenced"]), len(domains["reject"]))
+ logger.debug("blocklist[silenced]()=%d,blocklist[reject]()=%d", len(blocklist["silenced"]), len(blocklist["reject"]))
blockdict = list()
- if len(domains) > 0:
-
- for block_level in domains:
- logger.info("block_level='%s' has %d row(s)", block_level, len(domains[block_level]))
+ if len(blocking) > 0:
+ for block_level in blocklist:
+ logger.info("block_level='%s' has %d row(s)", block_level, len(blocklist[block_level]))
- for row in domains[block_level]:
+ for row in blocklist[block_level]:
logger.debug("row[%s]='%s'", type(row), row)
if instances.is_recent(row["domain"], "last_blocked"):
logger.debug("row[domain]='%s' has been recently crawled - SKIPPED!", row["domain"])