Skip to content

Instantly share code, notes, and snippets.

Created July 3, 2017 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/583ec369250141652d5e9ef3e9217467 to your computer and use it in GitHub Desktop.
Save anonymous/583ec369250141652d5e9ef3e9217467 to your computer and use it in GitHub Desktop.
Greasemonkey script that replaces pinyin cultivation levels in BTTH with literal translations
// ==UserScript==
// @name BTTH name rationalizer
// @description Replaces annoying af (imo) pinyin cultivation levels in BTTH with literal translations
// @namespace http://www.wuxiaworld.com/
// @match http://www.wuxiaworld.com/btth-index/*
// @version 1
// @grant none
// ==/UserScript==
var replacementPairs = [
[/(\W)Da\s+Dou\+Shi(s?\W)/g, "$1Grand Master$2"],
[/(\W)Ban\s+Sheng(s?\W)/g, "$1Half Saint$2"],
[/(\W)Dou(\W)/gi, "$1Battle$2"],
[/(\W)Qi(\W)/g, "$1Energy$2"],
[/(\W)Zhi(s?\W)/g, "$1Disciple$2"],
[/(\W)Zhe(s?\W)/g, "$1Practitioner$2"],
[/(\W)Shi(s?\W)/g, "$1Master$2"],
[/(\W)Ling(s?\W)/g, "$1Spirit$2"],
[/(\W)Wang(s?\W)/g, "$1King$2"],
[/(\W)Huang(s?\W)/g, "$1Emperor$2"],
[/(\W)Zong(s?\W)/gi, "$1Ancestor$2"],
[/(\W)Zhun(s?\W)/g, "$1Venerate$2"],
[/(\W)Sheng(s?\W)/g, "$1Saint$2"],
[/(\W)Di(s?\W)/g, "$1God$2"]
];
var temp = document.body.innerHTML
replacementPairs.forEach(function(item, index, array){
temp = temp.replace(item[0], item[1]);
});
document.body.innerHTML = temp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment