Skip to content

Instantly share code, notes, and snippets.

@andrewiankidd
Created November 8, 2016 12:33
Show Gist options
  • Select an option

  • Save andrewiankidd/f25f813f241554bb2b13686483e62146 to your computer and use it in GitHub Desktop.

Select an option

Save andrewiankidd/f25f813f241554bb2b13686483e62146 to your computer and use it in GitHub Desktop.
Replaces Fardad Farahzad with randomly generated names, using WaitforKeyElements and Chance
// ==UserScript==
// @name Fardad Farahzad is the first to like everything on facebook
// @namespace http://www.mozilla.org/keymast.....s.only.xul);
// @include https://www.facebook.com/*
// @version 1
// @require http://chancejs.com/chance.js
// @require http://code.jquery.com/jquery-latest.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
//name to filter
var oldname = 'Fardad Farahzad';
//wait for any spans containing old name
waitForKeyElements("span:contains('"+oldname+"')", namereplacer);
//take passed node, replace any instances of oldname with a rand name
function namereplacer(jNode) {
jNode.html(jNode.html().toString().replace(oldname, chance.name()));
}
@bilger321
Copy link
Copy Markdown

The script does not seem to work anymore, unfortunately.

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