Skip to content

Commit 87cfd54

Browse files
committed
feat(lists): add tech and prepare unsorted
1 parent e9bbd41 commit 87cfd54

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

scripts/generate_blocklists.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class ListSuffix(Enum):
2929
INDIEWIKI = "-by-indie-wiki"
3030
WIKIGG = "-by-wiki-gg"
3131
GAMING = "-gaming"
32+
TECH = "-tech"
33+
NONE = ""
3234

3335

3436
ROOT_PATH = Path(__file__).parent.parent
@@ -209,6 +211,13 @@ def process_ruleset(lines: list[str], topic: str, suffix: ListSuffix, suffixes:
209211
case ListSuffix.GAMING:
210212
description = "Low quality content farms related to gaming."
211213
lines = sanitize_lines(lines)
214+
case ListSuffix.TECH:
215+
description = "Low quality content farms related to technology"
216+
description += ", cyber security, cloud computing, coding, AI."
217+
lines = sanitize_lines(lines)
218+
case ListSuffix.NONE:
219+
description = "Random stuff."
220+
lines = sanitize_lines(lines)
212221
case ListSuffix.ALL:
213222
# input for aggregated lists is already sanitized
214223
# optimization happens in UnwantedSites
@@ -334,14 +343,26 @@ def main():
334343
suffixes = {}
335344
suffixes[0] = ListSuffix.ALL
336345
suffixes[1] = ListSuffix.GAMING
346+
suffixes[2] = ListSuffix.TECH
337347

338348
bundle[1] = []
339349
bundle[1] += get_source_file_lines(Path(SOURCE_PATH, "local_lq_content_farms.gaming.txt"))
340350
bundle[1] = process_ruleset(bundle[1], topic=topic, suffix=suffixes[1], suffixes=suffixes, args=args)
341351

352+
bundle[2] = []
353+
bundle[2] += get_source_file_lines(Path(SOURCE_PATH, "local_lq_content_farms.tech.txt"))
354+
bundle[2] = process_ruleset(bundle[2], topic=topic, suffix=suffixes[2], suffixes=suffixes, args=args)
342355

343356
process_full_bundle(bundle, topic=topic, suffix=suffixes[0], suffixes=suffixes, args=args)
344357

358+
topic = "unsorted"
359+
bundle = {}
360+
suffixes = {}
361+
suffixes[1] = ListSuffix.NONE
362+
363+
bundle[1] = []
364+
bundle[1] += get_source_file_lines(Path(SOURCE_PATH, "local_unsorted.txt"))
365+
bundle[1] = process_ruleset(bundle[1], topic=topic, suffix=suffixes[1], suffixes=suffixes, args=args)
345366

346367
if __name__ == "__main__":
347368
main()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
gachago.com/
2-
pocketgamer.com/
32
ldplayer.net/blog/
43
mumuplayer.com/blog/
4+
pocketgamer.com/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dannyda.com/

sources/local_unsorted.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)