-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for MediaWiki wikis with non-standard URLs #10
Comments
Hi, I just discovered the existence of this bot! I'm the one who made @wikilinksbot on Telegram. You may get some inspiration by how I solved this very problem in this commit (see lines 487–521). |
Hey, nice work! Glad to learn of the Telegram bot and will no doubt look into its code in the future (definitely in regards to magic words etc.). Your approach is interesting, but I will probably try to find something less complicated. People in mwclient/mwclient#34 suggest parsing HTML of modern wikis for For the configuring moderator, asking for the API path (maybe even linking to Special:Version on how to get it) is better in my case since the default |
Ah, that's an even better solution than what I used, agreed! I think I will implement this too. |
Improved the way the API URLs are found when setting the wiki URL. Based on suggestion in stjohann/DiscordWikiBot#10.
b77c40a adds the foundation for the changes required: URLs ending with |
Since the addition of support for different servers, it uses
/wiki/$1
pattern to detect whether something is a wiki or not. Judging by interwiki map on Meta-Wiki, we can see that this is not enough to determine whether something is a MediaWiki wiki or not: they can also use simple/$1
or something convoluted like/index.php?title=$1
or/index.php/$1
and still be valid wikis.This poses two problems for the current code:
/api.php
a hundred times./api.php
at the end of the string as a way to validate wiki URLs rather than/wiki/$1
. That way, the bot will ask the API and get and remember the article path from there. I didn’t hear any requests before asking about this problem, but it will be a good thing to do. All the old values with/wiki/$1
will need to be deprecated and updated in the configs.The removal of deprecation of old URLs will introduce a new major version (v.N.0.0) of the bot.
The text was updated successfully, but these errors were encountered: