-
-
Save anonymous/75212e254599fad1c0ce to your computer and use it in GitHub Desktop.
Creep Blocker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var bannedips=[] | |
var bannedurls=[] | |
var final_destination = "http://www.google.com" | |
var ip = '<!--#echo var="REMOTE_ADDR"-->' | |
var handleips=bannedips.join("|") | |
handleips=new RegExp(handleips, "i") | |
var handleurls=bannedurls.join("|") | |
handleurls=new RegExp(handleurls,"i") | |
if ((bannedips.length > 0 && ip.search(handleips)!=-1)||(bannedurls.length > 0 && document.referrer.search(handleurls)!=-1)){ | |
window.location.replace(final_destination) | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to Install: | |
Paste the entire code snippet just after the "<head>" tag. | |
How to Customise | |
Blacklisted IPs: | |
Edit bannedips | |
Must be quoted and have a comma between each quoted IP address. | |
Blacklisted Referrers: | |
Edit bannedurls | |
Must be quoted and have a comma between each quoted URL | |
Remember to leave off http:// in front of URL | |
License: | |
Public Domain. Do what you want with this just don't blame me. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment