AlphaKretin/bastion-bot

Add Japanese wiki search

Opened this issue · 0 comments

I intend to add a command to bring up a card's page on the Japanese yugioh-wiki.net website, that sometimes has rulings not documented on the official database. @pyrQ gave me these notes on implementing it.

JP wiki URL format: http://yugioh-wiki.net/index.php?《CARD_NAME》
The 《CARD_NAME》 part is what needs to be encoded. For example, Cyber Dragon, http://yugioh-wiki.net/index.php?《サイバー・ドラゴン》 (which doesn't work) becomes http://yugioh-wiki.net/index.php?%a1%d4%a5%b5%a5%a4%a5%d0%a1%bc%a1%a6%a5%c9%a5%e9%a5%b4%a5%f3%a1%d5 afterwards (and works).
The encoding thing/charset/whatever is called EUC (51932), which I found out using this site and is also how I experimented on various pages https://www.avekt.com/en-us/WebApps/UrlEncodeJapanese
The and seem to always be there for card pages and are static, %a1%d4 and %a1%d5 respectively. Non-card pages like Machine-Type or Special Summon seem to not be using them and just use the JP for the term (機械族 and 特殊召喚 respectively).