# # slang.tcl - June 24 2010 # by horgh # # Requires Tcl 8.5+ and tcllib # # Made with heavy inspiration from perpleXa's urbandict script! # # Must .chanset #channel +ud # # Uses is.gd to shorten long definition URL if isgd.tcl package present # package require htmlparse package require http package require tls ::http::register https 443 [list ::tls::socket -ssl2 0 -ssl3 0 -tls1 1] namespace eval ::ud { # set this to !ud or whatever you want variable trigger "slang" # maximum lines to output variable max_lines 1 # approximate characters per line variable line_length 400 # show truncated message / url if more than one line variable show_truncate 1 # toggle whether we store raw response data. # this will store the response from an http request to urbandictionary.com # in files for debugging. # NOTE: enabling this will cause a file to be created for every request # the script makes, so these can pile up quickly! variable store_responses 0 # the directory to store responses if store_responses is on. # this is under your eggdrop directory. # files under this directory will be named with unix timestamps # (microseconds). variable store_responses_dir slang_responses variable output_cmd "putserv" variable client "Mozilla/5.0 (compatible; Y!J; for robot study; keyoshid)" variable url https://www.urbandictionary.com/define.php variable url_random https://www.urbandictionary.com/random.php # regex to find the word variable word_regex {(.*?)} variable list_regex {