# # edited Jun 27 2017 for https by genewitch # ramok on freenode/#tcl knew the fix # # Mar 30 2010 # by horgh # # Requires Tcl 8.5+ and tcllib # # Wikipedia.org fetcher # # To enable you must .chanset #channel +wiki # # Tests: Whole number (list of possible interpretations) # package require http package require htmlparse package require tls ::http::register https 443 ::tls::socket namespace eval wiki { variable max_lines 1 variable max_chars 400 variable output_cmd "putserv" variable url "https://en.wikipedia.org/wiki/" #bind pub -|- "!w" wiki::search bind pub -|- "!wiki" wiki::search # variable parse_regexp {(.*?

.*?
)??.*?

(.*?)

\n)?.*?

(.*)(()|(

)).*?((
)|(
.*?((may refer to:)|(in one of the following senses:))

} $data]} { # regexp -- {