KevinPayravi / indie-wiki-buddy

Browser extension that automatically notifies and redirects you to independent wikis.
https://getindie.wiki
MIT License
275 stars 75 forks source link

Add a wiki: 遊戯王カードWiki (Yu-Gi-Oh Card Wiki) #415

Open SnorlaxMonster opened 9 months ago

SnorlaxMonster commented 9 months ago

Link to origin wiki: https://yugioh.fandom.com/ja/wiki/Yu-Gi-Oh!_Wiki Link to destination (independent) wiki: https://yugioh-wiki.net

Consider this one a challenge. yugioh-wiki.net runs on PukiWiki instead of MediaWiki. URLs appear to encode page titles as percent-encoded EUC-JP bytes for non-ASCII characters.

SnorlaxMonster commented 9 months ago

One additional complication: On yugioh-wiki.net, card pages (which are a very substantial part of the wiki) have their titles quoted in double angle brackets, whereas they do not on the Fandom wiki. Other pages do not quote their titles in this way.

For example, レベル・スティーラー on the Fandom wiki corresponds to 《レベル・スティーラー》 on yugioh-wiki.net. Whereas STARDUST OVERDRIVE on Fandom corresponds to STARDUST OVERDRIVE on yugioh-wiki.net.

yugioh-wiki.net does not appear to have redirects from the unquoted title to the quoted title, so it is important that redirects for card pages add the angle brackets in order for the redirection to be functional.

I'm not sure whether supporting this distinction is practical. Especially since the Japanese Fandom wiki doesn't even seem to categorize their pages or use a standard template on card pages, so you would likely need to hardcode in a list/reference an external list of Japanese Yu-Gi-Oh card names to know which page titles to quote. Or just only support one of the two title types when redirecting.

SnorlaxMonster commented 7 months ago

I investigated PukiWiki to see how feasible it would be to support redirecting to wikis running on that software.

PukiWiki has a URL endpoint for search, as demonstrated by http://side2.net/w/?cmd=search&word=example&type=AND According to the documentation, there is a variable called PLUGIN_SEARCH_DISABLE_GET_ACCESS that can be used to disable searching via GET request. The suggested reasoning why you would disable searching via GET request is "as a countermeasure against DoS attacks, spambots, and worms". If this variable is set in the site configuration, searching is only available via POST request.

Unfortunately, it appears that yugioh-wiki.net has disabled searching via GET request, so search is exclusively available via POST request.