fuddl / wd

a browser extension for wikidata
https://wikidata.org/wiki/Wikidata:Tools/Wikidata_for_Firefox
GNU General Public License v3.0
36 stars 6 forks source link

Miraheze article resolver #108

Open slweeb opened 1 year ago

slweeb commented 1 year ago

Some Miraheze wikis use a miraheze.org subdomain, like the Kirby Wiki, but others use a custom domain which the URL match pattern can't do, like the Nintendo Wiki. Can this be done?

fuddl commented 1 year ago

Can it be solved by adding multiple extractor patterns or would this be impractical? How many irregular url patterns are there? Are they the exception or the rule?

slweeb commented 1 year ago

There are many, according to me going to ones on this list. Any wiki can have a custom domain, so I'm not sure if we should have a pattern for each one, especially since more can appear.

I should've said this before, but: https://www.lgbtqia.wiki/wiki/Non-Binary is the same as https://lgbta.miraheze.org/wiki/Non-Binary Wikis with custom domains have a hidden ID, "lgbta", which is mentioned in the source code as "lgbtawiki". lgbta:Non-Binary would be the article ID

loominade commented 1 year ago

Here is a machine readable list of all miraheze wikis and where to find them: https://meta.miraheze.org/w/api.php?action=wikidiscover&format=json

edit: the same list excluding inactive wikis: https://meta.miraheze.org/w/api.php?action=wikidiscover&wdsiteprop=url%7Cdbname&wdstate=active&format=json

fuddl commented 1 year ago

ok, this enables me to either create a dedicated miraheze resolver or a resolver for irregular miraheze urls. Dunno which would be prefereble