Code: Select all
# minimum length a url has to be to auto-shorten it
variable minimum_length 15
# prefixes that you want the bot to watch for, to auto-shorten them
variable prefixes "http:// ftp:// www."
# number of minute(s) to ignore flooders, 0 to disable flood protection
variable ignore 1
# how many requests in how many seconds is considered flooding?
# by default, this allows 3 queries in 10 seconds, the 4th being ignored
# and ignoring requests for 'variable ignore' minutes
variable flood 4:10
Code: Select all
if {[regexp -- "(${prefix}.+)\[\\s+\]" $input - auto_shorten_url] == 1} {
Code: Select all
if {[regexp -- "(${prefix}.+?)(\s|$)" $input - auto_shorten_url] == 1} {