Created
July 2, 2026 08:36
-
-
Save nickserv/8d1f2f9e995118f1ad797503ab81af07 to your computer and use it in GitHub Desktop.
Wiki.gg setup for Pywikibot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disable default Pywikibot config so we can write it in Python | |
| # PYWIKIBOT_NO_USER_CONFIG=2 | |
| import pywikibot | |
| from typing import ClassVar | |
| def create_wiki_gg_site(subdomain: str, code: str = "en"): | |
| class Family(pywikibot.family.Family): | |
| name: ClassVar[str] = subdomain | |
| langs: ClassVar[dict[str, str]] = {code: f"{subdomain}.wiki.gg"} | |
| def scriptpath(self, code): | |
| return "" | |
| def protocol(self, code): | |
| return "https" | |
| return pywikibot.Site(code, Family()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment