diff options
| author | Fuwn <[email protected]> | 2025-02-10 04:20:19 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-10 04:20:19 -0800 |
| commit | b0d62dea04b52d77338d1fe973dcd64ff781b627 (patch) | |
| tree | 705d0f7c6001ae538f3923e4699af8a8b803e8da /generate_json.py | |
| parent | docs(readme): add icalendar installation instructions (diff) | |
| download | hololist-to-json-and-ical-b0d62dea04b52d77338d1fe973dcd64ff781b627.tar.xz hololist-to-json-and-ical-b0d62dea04b52d77338d1fe973dcd64ff781b627.zip | |
feat: add nijisanji support
Diffstat (limited to 'generate_json.py')
| -rw-r--r-- | generate_json.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generate_json.py b/generate_json.py index 579cfdc..ed36c4e 100644 --- a/generate_json.py +++ b/generate_json.py @@ -1,8 +1,10 @@ import requests import bs4 import json +import sys -response = requests.get("https://hololist.net/hololive-birthdays/") +profile = sys.argv[1] if len(sys.argv) > 1 else "hololive" +response = requests.get(f"https://hololist.net/{profile}-birthdays/") response.raise_for_status() @@ -41,5 +43,5 @@ for month_div in bs4.BeautifulSoup(response.text, "html.parser").find_all( } ) -with open("hololive_birthdays.json", "w", encoding="utf-8") as json_file: +with open(f"{profile}_birthdays.json", "w", encoding="utf-8") as json_file: json.dump(birthdays, json_file, ensure_ascii=False, indent=4) |