this snippet allows you to block url's from your chat, but it also allows you to allow certain links in your chat!
Replace http://google.com http://youtube.com and http://hawkee.com with the links that you want to allow. I dont take FULL credit for this napa did help :).
Be sure to put http:// :).
on $@*:text:/((http\x3A\/\/)?(w{3}\x2E)?\S+\x2E\S{2,3}?\S+)/Si:#:{
if (!$istok(http://google.com|http://youtube.com|http://hawkee.com,$regml(1),124)) {
kick $chan $nick The url you posted is not allowed in here!
}
}
The common domain extensions are mostly 2 to 3 characters long, but there are more characters than that. The longest one has to be .museum, which is 6 characters long. Here is an APPROXIMATE domain extension names for their uses and your reference:> .com — commercial entities
.org — non-profit organizations
.net -Internet infrastructure and network providers
.edu/.ac — educational institutions
.mil — US military
.gov — reserved for US intergovernmental organizations
.int — international organizations
.biz — business web sites
.name — used by individuals or families for personal use
.info — unrestricted extension for informational websites
.pro — for professional organizations and credentialed professionals
.aero — air-transport industry websites
.museum — for museums
.coop — cooperative associations NOTE: This list does not include .ca .it .tw .cn etc...for other country domain extensions.
You could have done it like so:
on $@*:text:/(^| )(http\072\/\/w{3}\.|w{3}\.)(?!hawkee|google|youtube).+(\.\S{2,6})( |$)/Si:#:{
kick # $nick The URL you posted is not allowed in here!
}
This will exclude URL consists of hawkee, google and youtube. The domain extension can be as long as 6 characters, not just 3.
I think you should try to solve the !istok part with something else. Because if someone wants to block more then 3 websited they get way too long lines. Maby an alias that checks a file with the websites in it?
Plus maby add a line that messages the channel that someone has sent a link that isnt allowed. This should be simple to add!
:) For the rest good job!
I believe the script only block URL that is not on the allow list however if the way he has it only allow 3 website then I would agree changing to allow more site.
It would be nice if the owner of this script would update and set it where the bot will not kick staff or add a exception where only those who is on the exception list can post non-allowed domains.
Also the script need updating it should not be kicking bot such as weather bot when user are checking there weather and the weather bot get booted from the channel.
otherwise it is a pretty good script "Good Job" Please update Thank you!