Skip to content

Instantly share code, notes, and snippets.

@paul-butcher
Last active November 5, 2021 14:07
Show Gist options
  • Select an option

  • Save paul-butcher/6ba25f6b5a4f8727be4824e0c9fa48e7 to your computer and use it in GitHub Desktop.

Select an option

Save paul-butcher/6ba25f6b5a4f8727be4824e0c9fa48e7 to your computer and use it in GitHub Desktop.
wikipedia userscript to help make Richard Desmond more comfortable about his career
// ==UserScript==
// @name Porn-Phil
// @version 1
// @grant none
// @include https://*.wikipedia.org/*
// ==/UserScript==
// Replace any references to pornography with philanthropy
(function() {
var textnodes = document.evaluate(
"//body//text()[not(ancestor::script) and not(ancestor::style)]",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null
), node, text;
for(var i = 0; i < textnodes.snapshotLength; i++) {
node = textnodes.snapshotItem(i);
text = node.data;
text = text.replace(/([pP])ornographer/g, '$1hilanthropist').replace(/([pP])ornograph/g, '$1hilanthrop');
node.data = text;
}
}).call(this);
@paul-butcher
Copy link
Author

Inspired by this recent news story: https://www.theguardian.com/media/2021/nov/05/richard-desmond-in-legal-battle-with-wikipedia-over-term-pornographer. Because my childish streak thought it might be funny.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment