Skip to content

Instantly share code, notes, and snippets.

@sorz
Created May 3, 2015 12:24
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 sorz/7b594aafb24ce6628ed3 to your computer and use it in GitHub Desktop.
Save sorz/7b594aafb24ce6628ed3 to your computer and use it in GitHub Desktop.
Apply correct Chinese name on AcFun.
// ==UserScript==
// @name 缺B乐
// @namespace org.sorz.lab.queble
// @include http://www.acfun.tv/*
// @version 1
// @grant none
// ==/UserScript==
String.prototype.correct = function () {
return this.toString()
.replace(/AcFun/gi, '缺B乐')
.replace(/\bAC\b/g, '缺B');
}
function correctText() {
var $this = $(this);
$this.text($this.text().correct());
}
$(document).ready(function () {
document.title = document.title.correct();
$('.title').each(correctText);
$('a.tag').each(correctText);
$('h1').each(correctText);
$('h2').each(correctText);
$('#footer-inner').find('a').each(correctText);
$('.bottom-footer').find('p').each(correctText);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment