Code:mywiki.py: Difference between revisions
From 20R1
example mywiki.py code |
(No difference)
|
Latest revision as of 03:10, 15 July 2025
from pywikibot import family
class Family(family.Family):
name = 'mywiki' # Unique identifier for your wiki
langs = {
'en': 'wiki.yourdomain.com', # Your wiki's domain
}
def protocol(self, code):
return 'https' # Use 'http' if your wiki doesn't use HTTPS
def scriptpath(self, code):
return '/w' # Path to wiki scripts, typically '/w' for MediaWiki
def apipath(self, code):
return f'{self.scriptpath(code)}/api.php'
