Skip to content

Commit d8e82e9

Browse files
authored
Merge pull request #13 from codeshell/fix/iwb-data-source
fix(iwb): new data source repo
2 parents 9aed488 + bfac726 commit d8e82e9

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

scripts/import_from_indie_wiki.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Fetches redirect definitions from indie-wiki-buddy and safes them as plain text list of subdomain names.
3-
Datasource: https://github.com/KevinPayravi/indie-wiki-buddy
3+
Tool: https://github.com/KevinPayravi/indie-wiki-buddy
4+
Datasource: https://github.com/KevinPayravi/indie-wiki-buddy-data
45
"""
56

67
import argparse
@@ -26,8 +27,8 @@ class ChangeLog(Enum):
2627
MY_DESCRIPTION = (
2728
"Fetches redirect definitions from indie-wiki-buddy and safes them as plain text list of subdomain names."
2829
)
29-
SOURCE_URL_FOLDER = "https://raw.githubusercontent.com/KevinPayravi/indie-wiki-buddy/refs/heads/main/data/"
30-
SOURCE_TREE = "https://api.github.com/repos/KevinPayravi/indie-wiki-buddy/git/trees/main"
30+
SOURCE_URL_FOLDER = "https://raw.githubusercontent.com/KevinPayravi/indie-wiki-buddy-data/refs/heads/main/data/"
31+
SOURCE_TREE = "https://api.github.com/repos/KevinPayravi/indie-wiki-buddy-data/git/trees/main"
3132
ROOT_PATH = Path(__file__).parent.parent
3233
IMPORT_PREFIX = "import_from_indie_wiki"
3334
IMPORT_FOLDER = Path(ROOT_PATH, "sources")
@@ -61,14 +62,14 @@ def create_list_from_json(json_object, site_import_file, args: argparse.Namespac
6162
text = []
6263
for wiki in json_object:
6364
if isinstance(wiki, list):
64-
print(type(wiki))
65-
print(f"Not implemented for {wiki}")
65+
print(f"Found: {type(wiki)}")
66+
print(f" Not implemented for {wiki}")
6667
elif isinstance(wiki, dict):
6768
for origin in wiki.get("origins", []):
6869
text.append(get_unwanted_from_origin(origin))
6970
else:
70-
print(type(wiki))
71-
print(f"Strange things happened with {wiki}")
71+
print(f"Found: {type(wiki)}")
72+
print(f" Strange things happened with {wiki}")
7273

7374
# optimized_list = sorted(set(text.split("\n")))
7475
optimized_list = sorted(set(filter(None, text)))
@@ -306,7 +307,7 @@ def process_sites_with_changes(sites_with_changes: dict, args: argparse.Namespac
306307
else:
307308
critical_errors.append(f"UPD: {filename}")
308309

309-
if len(critical_errors) == 0:
310+
if len(critical_errors) != 0:
310311
print(critical_errors)
311312

312313
return len(critical_errors) == 0

0 commit comments

Comments
 (0)