<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/20157" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2021-11-18T03:27:09-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/20157</id>

		<entry>
		<author><name><![CDATA[thommey]]></name></author>
		<updated>2017-08-02T06:46:01-04:00</updated>

		<published>2017-08-02T06:46:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106399#p106399</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106399#p106399"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106399#p106399"><![CDATA[
There is so much wrong information in this thread, I don't even know where to begin. But the most dangerous one is clearly<br><blockquote class="uncited"><div>This error that comes out is an error of its version eggdrop version 1.8.1 is full of errors, my bot uses version 1.6.20 and works great.. </div></blockquote>Eggdrop1.6.x does simply not compile on modern systems without a heap of ./configure options and extra compiler flags. Eggdrop1.8.x is <strong class="text-strong">based on</strong> 1.6.21 and fully compatible, you might as well think of it as 1.6.24. <strong class="text-strong">If you find any problems using Eggdrop1.8.x, please report them to us at <a href="https://github.com/eggheads/eggdrop" class="postlink">https://github.com/eggheads/eggdrop</a></strong>. It is <strong class="text-strong">actively developed</strong> and 1.6.x is not. We <strong class="text-strong">will</strong> fix every single bug you find that is an Eggdrop bug. The problems mentioned in this thread are exclusively related to Tcl installations, and Eggdrop1.6.20 will have just the same problems on that system as Eggdrop1.8.1 and <strong class="text-strong">in addition</strong> is a lot more work to get to compile and find Tcl, etc. Eggdrop1.8.1 should compile using ./configure only, without all those arguments you have to figure out first. If it can't find Tcl, make sure you have the tcl-dev or tcl-devel package from your operating system installed. The fact that "it works for you" on 1.6.20 has nothing to do with the Eggdrop version, Tcl version or http version but with the environment, Tcl installation paths, and package installation paths (tcllib, tls), and age of the system (/usr/lib vs. /usr/lib/x86_64-linux-gnu).<br><br>Recommending to manually find and load http.tcl (which isn't even the right format used by Tcl to ship it anymore), json.tcl, htmlparse.tcl and others is completely wrong and dangerous. Those scripts won't update with your operating system, might rely on other packages, are incompatible with the ones you already have installed, and manually sourcing them prevents the loading of newer ones. It is also much more effort than the real solutions below.<br><br>Now to the whole package situation, where a lot of confusion is spread.<br><br><span style="text-decoration:underline">The http package</span><br><br>The <strong class="text-strong">http</strong> package is <strong class="text-strong">shipped with Tcl</strong>. You <strong class="text-strong">never ever</strong> need to manually source or download http.tcl. Start "tclsh" on your shell, try "package require http", it will work in 99.99% of the cases. Same situation in Eggdrop. Please avoid loading or sourcing any http.tcl you got from anywhere, including the one posted here. If you get an error about "http::geturl is an unknown command" or similar, make sure the script you are trying to load has "package require http" in one of its first lines. Do make sure you have the usual operating system packages installed to compile Eggdrop with Tcl (tcl-dev or tcl-devel). If it still fails, recompile Eggdrop.<br><br><span style="text-decoration:underline">The tcllib packages (json, htmlparse)</span><br><br>The <strong class="text-strong">json</strong> and <strong class="text-strong">htmlparse</strong> packages are part of <a href="http://core.tcl.tk/tcllib" class="postlink">Tcllib</a>. The usual package name is "tcllib" on debian and other operating systems (apt-get install tcllib). The path to Tcllib could be non-standard and if Eggdrop fails to find a package at a "package require json" line or similar, you can either set the TCLLIBPATH environment variable in your shell before starting it, set it in your config (set env(TCLLIBPATH) /path/to/that/file) or go find tcllib's main "pkgIndex.tcl" file and add its path to the auto_path variable (see below, "Fixing package require errors").<br><br><span style="text-decoration:underline">The tls package</span><br><br>The <strong class="text-strong">tls</strong> package is, like the json and htmlparse packages, independent from Tcl and shipped separately, but not part of tcllib. The debian package name to install is "tcl-tls". If a "package require tls" in Eggdrop does not find it, see below ("Fixing package require errors"). If it loads fine but the script in question doesn't seem to be able to connect to h<strong class="text-strong"></strong>ttps:// sites, change its <div class="codebox"><p>Code: </p><pre><code>http::register https 443 tls::socket</code></pre></div> line to <div class="codebox"><p>Code: </p><pre><code>http::register https 443 {tls::socket -tls1 1}</code></pre></div>Or upgrade your tcl-tls package to at least version 1.7.<br><br><span style="text-decoration:underline">Fixing package require errors</span><br><br>Fixing packages that can't be found (does <strong class="text-strong">NOT</strong> apply to http, msgcat, clock, because they are <strong class="text-strong">always</strong> shipped with Tcl itself):<ol style="list-style-type:decimal"><li>Find the relevant most top-level pkgIndex.tcl file associated with it. e.g. <div class="codebox"><p>Code: </p><pre><code>find /usr -name pkgIndex.tcl</code></pre></div></li><li>Add its <strong class="text-strong">path</strong> (without the filename) to your config to the auto_path variable like so: <div class="codebox"><p>Code: </p><pre><code>lappend ::auto_path /usr/share/tcltk/tcllib1.14</code></pre></div> or <div class="codebox"><p>Code: </p><pre><code>lappend ::auto_path /usr/share/tcltk/tls1.6</code></pre></div>Do this before sourcing any scripts.</li></ol>That's it, the package should now be found and load fine. You can have multiple of those lines, each one adds a package search path to Tcl.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9830">thommey</a> — Wed Aug 02, 2017 6:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2017-08-01T20:24:07-04:00</updated>

		<published>2017-08-01T20:24:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106397#p106397</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106397#p106397"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106397#p106397"><![CDATA[
regards<br>This error that comes out is an error of its version eggdrop version 1.8.1 is full of errors, my bot uses version 1.6.20 and works great..<br><br>But try with these additional tcl and tell me if it works<br><div class="codebox"><p>Code: </p><pre><code># http.tcl --##Client-side HTTP for GET, POST, and HEAD commands. These routines can#be used in untrusted code that uses the Safesock security policy.#These procedures use a callback interface to avoid using vwait, which#is not defined in the safe base.## See the file "license.terms" for information on usage and redistribution of# this file, and for a DISCLAIMER OF ALL WARRANTIES.package require Tcl 8.4# Keep this in sync with pkgIndex.tcl and with the install directories in# Makefilespackage provide http 2.7.12namespace eval http {    # Allow resourcing to not clobber existing data    variable http    if {![info exists http]} {array set http {    -accept */*    -proxyhost {}    -proxyport {}    -proxyfilter http::ProxyRequired    -urlencoding utf-8}set http(-useragent) "Tcl http client package [package provide http]"    }    proc init {} {# Set up the map for quoting chars. RFC3986 Section 2.3 say percent# encode all except: "... percent-encoded octets in the ranges of# ALPHA (%41-%5A and %61-%7A), DIGIT (%30-%39), hyphen (%2D), period# (%2E), underscore (%5F), or tilde (%7E) should not be created by URI# producers ..."for {set i 0} {$i &lt;= 256} {incr i} {    set c [format %c $i]    if {![string match {[-._~a-zA-Z0-9]} $c]} {set map($c) %[format %.2X $i]    }}# These are handled speciallyset map(\n) %0D%0Avariable formMap [array get map]# Create a map for HTTP/1.1 open socketsvariable socketmapif {[info exists socketmap]} {    # Close but don't remove open sockets on re-init    foreach {url sock} [array get socketmap] {catch {close $sock}    }}array set socketmap {}    }    init    variable urlTypes    if {![info exists urlTypes]} {set urlTypes(http) [list 80 ::socket]    }    variable encodings [string tolower [encoding names]]    # This can be changed, but iso8859-1 is the RFC standard.    variable defaultCharset    if {![info exists defaultCharset]} {set defaultCharset "iso8859-1"    }    # Force RFC 3986 strictness in geturl url verification?    variable strict    if {![info exists strict]} {set strict 1    }    # Let user control default keepalive for compatibility    variable defaultKeepalive    if {![info exists defaultKeepalive]} {set defaultKeepalive 0    }    namespace export geturl config reset wait formatQuery register unregister    # Useful, but not exported: data size status code}# http::Log --##Debugging output -- define this to observe HTTP/1.1 socket usage.#Should echo any args received.## Arguments:#     msgMessage to output#proc http::Log {args} {}# http::register --##     See documentation for details.## Arguments:#     protoURL protocol prefix, e.g. https#     portDefault port for protocol#     commandCommand to use to create socket# Results:#     list of port and command that was registered.proc http::register {proto port command} {    variable urlTypes    set urlTypes($proto) [list $port $command]}# http::unregister --##     Unregisters URL protocol handler## Arguments:#     protoURL protocol prefix, e.g. https# Results:#     list of port and command that was unregistered.proc http::unregister {proto} {    variable urlTypes    if {![info exists urlTypes($proto)]} {return -code error "unsupported url type \"$proto\""    }    set old $urlTypes($proto)    unset urlTypes($proto)    return $old}# http::config --##See documentation for details.## Arguments:#argsOptions parsed by the procedure.# Results:#        TODOproc http::config {args} {    variable http    set options [lsort [array names http -*]]    set usage [join $options ", "]    if {[llength $args] == 0} {set result {}foreach name $options {    lappend result $name $http($name)}return $result    }    set options [string map {- ""} $options]    set pat ^-(?:[join $options |])$    if {[llength $args] == 1} {set flag [lindex $args 0]if {![regexp -- $pat $flag]} {    return -code error "Unknown option $flag, must be: $usage"}return $http($flag)    } else {foreach {flag value} $args {    if {![regexp -- $pat $flag]} {return -code error "Unknown option $flag, must be: $usage"    }    set http($flag) $value}    }}# http::Finish --##Clean up the socket and eval close time callbacks## Arguments:#token    Connection token.#errormsg    (optional) If set, forces status to error.#       skipCB      (optional) If set, don't call the -command callback. This#    is useful when geturl wants to throw an exception instead#    of calling the callback. That way, the same error isn't#    reported to two places.## Side Effects:#        Closes the socketproc http::Finish {token {errormsg ""} {skipCB 0}} {    variable $token    upvar 0 $token state    global errorInfo errorCode    if {$errormsg ne ""} {set state(error) [list $errormsg $errorInfo $errorCode]set state(status) "error"    }    if {($state(status) eq "timeout") || ($state(status) eq "error") ||([info exists state(connection)] &amp;&amp; ($state(connection) eq "close"))    } then {        CloseSocket $state(sock) $token    }    if {[info exists state(after)]} {after cancel $state(after)    }    if {[info exists state(-command)] &amp;&amp; !$skipCB    &amp;&amp; ![info exists state(done-command-cb)]} {set state(done-command-cb) yesif {[catch {eval $state(-command) {$token}} err] &amp;&amp; $errormsg eq ""} {    set state(error) [list $err $errorInfo $errorCode]    set state(status) error}    }}# http::CloseSocket -##Close a socket and remove it from the persistent sockets table.  If#possible an http token is included here but when we are called from a#fileevent on remote closure we need to find the correct entry - hence#the second section.proc ::http::CloseSocket {s {token {}}} {    variable socketmap    catch {fileevent $s readable {}}    set conn_id {}    if {$token ne ""} {        variable $token        upvar 0 $token state        if {[info exists state(socketinfo)]} {    set conn_id $state(socketinfo)        }    } else {        set map [array get socketmap]        set ndx [lsearch -exact $map $s]        if {$ndx != -1} {    incr ndx -1    set conn_id [lindex $map $ndx]        }    }    if {$conn_id eq {} || ![info exists socketmap($conn_id)]} {        Log "Closing socket $s (no connection info)"        if {[catch {close $s} err]} {    Log "Error: $err"}    } else {if {[info exists socketmap($conn_id)]} {    Log "Closing connection $conn_id (sock $socketmap($conn_id))"    if {[catch {close $socketmap($conn_id)} err]} {Log "Error: $err"    }    unset socketmap($conn_id)} else {    Log "Cannot close connection $conn_id - no socket in socket map"}    }}# http::reset --##See documentation for details.## Arguments:#tokenConnection token.#whyStatus info.## Side Effects:#       See Finishproc http::reset {token {why reset}} {    variable $token    upvar 0 $token state    set state(status) $why    catch {fileevent $state(sock) readable {}}    catch {fileevent $state(sock) writable {}}    Finish $token    if {[info exists state(error)]} {set errorlist $state(error)unset stateeval ::error $errorlist    }}# http::geturl --##Establishes a connection to a remote url via http.## Arguments:#       urlThe http URL to goget.#       argsOption value pairs. Valid options include:#-blocksize, -validate, -headers, -timeout# Results:#Returns a token for this connection. This token is the name of an#array that the caller should unset to garbage collect the state.proc http::geturl {url args} {    variable http    variable urlTypes    variable defaultCharset    variable defaultKeepalive    variable strict    # Initialize the state variable, an array. We'll return the name of this    # array as the token for the transaction.    if {![info exists http(uid)]} {set http(uid) 0    }    set token [namespace current]::[incr http(uid)]    variable $token    upvar 0 $token state    reset $token    # Process command options.    array set state {-binaryfalse-blocksize8192-queryblocksize 8192-validate0-headers{}-timeout0-typeapplication/x-www-form-urlencoded-queryprogress{}-protocol1.1binary0stateconnectingmeta{}coding{}currentsize0totalsize0querylength0queryoffset0typetext/htmlbody{}status""http""connectionclose    }    set state(-keepalive) $defaultKeepalive    set state(-strict) $strict    # These flags have their types verified [Bug 811170]    array set type {-binaryboolean-blocksizeinteger-queryblocksize integer-strictboolean-timeoutinteger-validateboolean    }    set state(charset)$defaultCharset    set options {-binary -blocksize -channel -command -handler -headers -keepalive-method -myaddr -progress -protocol -query -queryblocksize-querychannel -queryprogress -strict -timeout -type -validate    }    set usage [join [lsort $options] ", "]    set options [string map {- ""} $options]    set pat ^-(?:[join $options |])$    foreach {flag value} $args {if {[regexp -- $pat $flag]} {    # Validate numbers    if {[info exists type($flag)] &amp;&amp;![string is $type($flag) -strict $value]    } then {unset $tokenreturn -code error \    "Bad value for $flag ($value), must be $type($flag)"    }    set state($flag) $value} else {    unset $token    return -code error "Unknown option $flag, can be: $usage"}    }    # Make sure -query and -querychannel aren't both specified    set isQueryChannel [info exists state(-querychannel)]    set isQuery [info exists state(-query)]    if {$isQuery &amp;&amp; $isQueryChannel} {unset $tokenreturn -code error "Can't combine -query and -querychannel options!"    }    # Validate URL, determine the server host and port, and check proxy case    # Recognize user:pass@host URLs also, although we do not do anything with    # that info yet.    # URLs have basically four parts.    # First, before the colon, is the protocol scheme (e.g. http)    # Second, for HTTP-like protocols, is the authority    #The authority is preceded by // and lasts up to (but not including)    #the following / or ? and it identifies up to four parts, of which    #only one, the host, is required (if an authority is present at all).    #All other parts of the authority (user name, password, port number)    #are optional.    # Third is the resource name, which is split into two parts at a ?    #The first part (from the single "/" up to "?") is the path, and the    #second part (from that "?" up to "#") is the query. *HOWEVER*, we do    #not need to separate them; we send the whole lot to the server.    #Both, path and query are allowed to be missing, including their    #delimiting character.    # Fourth is the fragment identifier, which is everything after the first    #"#" in the URL. The fragment identifier MUST NOT be sent to the server    #and indeed, we don't bother to validate it (it could be an error to    #pass it in here, but it's cheap to strip).    #    # An example of a URL that has all the parts:    #    #     http://jschmoe:xyzzy@www.bogus.net:8000/foo/bar.tml?q=foo#changes    #    # The "http" is the protocol, the user is "jschmoe", the password is    # "xyzzy", the host is "www.bogus.net", the port is "8000", the path is    # "/foo/bar.tml", the query is "q=foo", and the fragment is "changes".    #    # Note that the RE actually combines the user and password parts, as    # recommended in RFC 3986. Indeed, that RFC states that putting passwords    # in URLs is a Really Bad Idea, something with which I would agree utterly.    # Also note that we do not currently support IPv6 addresses.    #    # From a validation perspective, we need to ensure that the parts of the    # URL that are going to the server are correctly encoded.  This is only    # done if $state(-strict) is true (inherited from $::http::strict).    set URLmatcher {(?x)# this is _expanded_ syntax^(?: (\w+) : ) ?# &lt;protocol scheme&gt;(?: //    (?:(    [^@/\#?]+# &lt;userinfo part of authority&gt;) @    )?    ( [^/:\#?]+ )# &lt;host part of authority&gt;    (?: : (\d+) )?# &lt;port part of authority&gt;)?( [/\?] [^\#]*)?# &lt;path&gt; (including query)(?: \# (.*) )?# &lt;fragment&gt;$    }    # Phase one: parse    if {![regexp -- $URLmatcher $url -&gt; proto user host port srvurl]} {unset $tokenreturn -code error "Unsupported URL: $url"    }    # Phase two: validate    if {$host eq ""} {# Caller has to provide a host name; we do not have a "default host"# that would enable us to handle relative URLs.unset $tokenreturn -code error "Missing host part: $url"# Note that we don't check the hostname for validity here; if it's# invalid, we'll simply fail to resolve it later on.    }    if {$port ne "" &amp;&amp; $port &gt; 65535} {unset $tokenreturn -code error "Invalid port number: $port"    }    # The user identification and resource identification parts of the URL can    # have encoded characters in them; take care!    if {$user ne ""} {# Check for validity according to RFC 3986, Appendix Aset validityRE {(?xi)    ^    (?: [-\w.~!$&amp;'()*+,;=:] | %[0-9a-f][0-9a-f] )+    $}if {$state(-strict) &amp;&amp; ![regexp -- $validityRE $user]} {    unset $token    # Provide a better error message in this error case    if {[regexp {(?i)%(?![0-9a-f][0-9a-f]).?.?} $user bad]} {return -code error \"Illegal encoding character usage \"$bad\" in URL user"    }    return -code error "Illegal characters in URL user"}    }    if {$srvurl ne ""} {# RFC 3986 allows empty paths (not even a /), but servers# return 400 if the path in the HTTP request doesn't start# with / , so add it here if needed.if {[string index $srvurl 0] ne "/"} {    set srvurl /$srvurl}# Check for validity according to RFC 3986, Appendix Aset validityRE {(?xi)    ^    # Path part (already must start with / character)    (?:      [-\w.~!$&amp;'()*+,;=:@/]  | %[0-9a-f][0-9a-f] )*    # Query part (optional, permits ? characters)    (?: \? (?: [-\w.~!$&amp;'()*+,;=:@/?] | %[0-9a-f][0-9a-f] )* )?    $}if {$state(-strict) &amp;&amp; ![regexp -- $validityRE $srvurl]} {    unset $token    # Provide a better error message in this error case    if {[regexp {(?i)%(?![0-9a-f][0-9a-f])..} $srvurl bad]} {return -code error \    "Illegal encoding character usage \"$bad\" in URL path"    }    return -code error "Illegal characters in URL path"}    } else {set srvurl /    }    if {$proto eq ""} {set proto http    }    if {![info exists urlTypes($proto)]} {unset $tokenreturn -code error "Unsupported URL type \"$proto\""    }    set defport [lindex $urlTypes($proto) 0]    set defcmd [lindex $urlTypes($proto) 1]    if {$port eq ""} {set port $defport    }    if {![catch {$http(-proxyfilter) $host} proxy]} {set phost [lindex $proxy 0]set pport [lindex $proxy 1]    }    # OK, now reassemble into a full URL    set url ${proto}://    if {$user ne ""} {append url $userappend url @    }    append url $host    if {$port != $defport} {append url : $port    }    append url $srvurl    # Don't append the fragment!    set state(url) $url    # If a timeout is specified we set up the after event and arrange for an    # asynchronous socket connection.    set sockopts [list -async]    if {$state(-timeout) &gt; 0} {set state(after) [after $state(-timeout) \[list http::reset $token timeout]]    }    # If we are using the proxy, we must pass in the full URL that includes    # the server name.    if {[info exists phost] &amp;&amp; ($phost ne "")} {set srvurl $urlset targetAddr [list $phost $pport]    } else {set targetAddr [list $host $port]    }    # Proxy connections aren't shared among different hosts.    set state(socketinfo) $host:$port    # See if we are supposed to use a previously opened channel.    if {$state(-keepalive)} {variable socketmapif {[info exists socketmap($state(socketinfo))]} {    if {[catch {fconfigure $socketmap($state(socketinfo))}]} {Log "WARNING: socket for $state(socketinfo) was closed"unset socketmap($state(socketinfo))    } else {set sock $socketmap($state(socketinfo))Log "reusing socket $sock for $state(socketinfo)"catch {fileevent $sock writable {}}catch {fileevent $sock readable {}}    }}# don't automatically close this connection socketset state(connection) {}    }    if {![info exists sock]} {# Pass -myaddr directly to the socket commandif {[info exists state(-myaddr)]} {    lappend sockopts -myaddr $state(-myaddr)}        if {[catch {eval $defcmd $sockopts $targetAddr} sock]} {    # something went wrong while trying to establish the connection.    # Clean up after events and such, but DON'T call the command    # callback (if available) because we're going to throw an    # exception from here instead.    set state(sock) $sock    Finish $token "" 1    cleanup $token    return -code error $sock        }    }    set state(sock) $sock    Log "Using $sock for $state(socketinfo)" \        [expr {$state(-keepalive)?"keepalive":""}]    if {$state(-keepalive)} {        set socketmap($state(socketinfo)) $sock    }    if {![info exists phost]} {set phost ""    }    fileevent $sock writable [list http::Connect $token $proto $phost $srvurl]    # Wait for the connection to complete.    if {![info exists state(-command)]} {# geturl does EVERYTHING asynchronously, so if the user# calls it synchronously, we just do a wait here.http::wait $tokenif {![info exists state]} {    # If we timed out then Finish has been called and the users    # command callback may have cleaned up the token. If so we end up    # here with nothing left to do.    return $token} elseif {$state(status) eq "error"} {    # Something went wrong while trying to establish the connection.    # Clean up after events and such, but DON'T call the command    # callback (if available) because we're going to throw an    # exception from here instead.    set err [lindex $state(error) 0]    cleanup $token    return -code error $err}    }    return $token}proc http::Connected { token proto phost srvurl} {    variable http    variable urlTypes    variable $token    upvar 0 $token state    # Set back the variables needed here    set sock $state(sock)    set isQueryChannel [info exists state(-querychannel)]    set isQuery [info exists state(-query)]    set host [lindex [split $state(socketinfo) :] 0]    set port [lindex [split $state(socketinfo) :] 1]    set defport [lindex $urlTypes($proto) 0]    # Send data in cr-lf format, but accept any line terminators    fconfigure $sock -translation {auto crlf} -buffersize $state(-blocksize)    # The following is disallowed in safe interpreters, but the socket is    # already in non-blocking mode in that case.    catch {fconfigure $sock -blocking off}    set how GET    if {$isQuery} {set state(querylength) [string length $state(-query)]if {$state(querylength) &gt; 0} {    set how POST    set contDone 0} else {    # There's no query data.    unset state(-query)    set isQuery 0}    } elseif {$state(-validate)} {set how HEAD    } elseif {$isQueryChannel} {set how POST# The query channel must be blocking for the async Write to# work properly.fconfigure $state(-querychannel) -blocking 1 -translation binaryset contDone 0    }    if {[info exists state(-method)] &amp;&amp; $state(-method) ne ""} {set how $state(-method)    }    if {[catch {puts $sock "$how $srvurl HTTP/$state(-protocol)"puts $sock "Accept: $http(-accept)"array set hdrs $state(-headers)if {[info exists hdrs(Host)]} {    # Allow Host spoofing. [Bug 928154]    puts $sock "Host: $hdrs(Host)"} elseif {$port == $defport} {    # Don't add port in this case, to handle broken servers. [Bug    # #504508]    puts $sock "Host: $host"} else {    puts $sock "Host: $host:$port"}unset hdrsputs $sock "User-Agent: $http(-useragent)"        if {$state(-protocol) == 1.0 &amp;&amp; $state(-keepalive)} {    puts $sock "Connection: keep-alive"        }        if {$state(-protocol) &gt; 1.0 &amp;&amp; !$state(-keepalive)} {    puts $sock "Connection: close" ;# RFC2616 sec 8.1.2.1        }        if {[info exists phost] &amp;&amp; ($phost ne "") &amp;&amp; $state(-keepalive)} {    puts $sock "Proxy-Connection: Keep-Alive"        }        set accept_encoding_seen 0set content_type_seen 0foreach {key value} $state(-headers) {    if {[string equal -nocase $key "host"]} {continue    }    if {[string equal -nocase $key "accept-encoding"]} {set accept_encoding_seen 1    }    if {[string equal -nocase $key "content-type"]} {set content_type_seen 1    }    set value [string map [list \n "" \r ""] $value]    set key [string trim $key]    if {[string equal -nocase $key "content-length"]} {set contDone 1set state(querylength) $value    }    if {[string length $key]} {puts $sock "$key: $value"    }}# Soft zlib dependency check - no package require        if {    !$accept_encoding_seen &amp;&amp;    ([package vsatisfies [package provide Tcl] 8.6]|| [llength [package provide zlib]]) &amp;&amp;    !([info exists state(-channel)] || [info exists state(-handler)])        } then {    puts $sock "Accept-Encoding: gzip, identity, *;q=0.1"        }if {$isQueryChannel &amp;&amp; $state(querylength) == 0} {    # Try to determine size of data in channel. If we cannot seek, the    # surrounding catch will trap us    set start [tell $state(-querychannel)]    seek $state(-querychannel) 0 end    set state(querylength) \    [expr {[tell $state(-querychannel)] - $start}]    seek $state(-querychannel) $start}# Flush the request header and set up the fileevent that will either# push the POST data or read the response.## fileevent note:## It is possible to have both the read and write fileevents active at# this point. The only scenario it seems to affect is a server that# closes the connection without reading the POST data. (e.g., early# versions TclHttpd in various error cases). Depending on the# platform, the client may or may not be able to get the response from# the server because of the error it will get trying to write the post# data.  Having both fileevents active changes the timing and the# behavior, but no two platforms (among Solaris, Linux, and NT) behave# the same, and none behave all that well in any case. Servers should# always read their POST data if they expect the client to read their# response.if {$isQuery || $isQueryChannel} {    if {!$content_type_seen} {puts $sock "Content-Type: $state(-type)"    }    if {!$contDone} {puts $sock "Content-Length: $state(querylength)"    }    puts $sock ""    fconfigure $sock -translation {auto binary}    fileevent $sock writable [list http::Write $token]} else {    puts $sock ""    flush $sock    fileevent $sock readable [list http::Event $sock $token]}    } err]} then {# The socket probably was never connected, or the connection dropped# later.# if state(status) is error, it means someone's already called Finish# to do the above-described clean up.if {$state(status) ne "error"} {    Finish $token $err}    }}# Data access functions:# Data - the URL data# Status - the transaction status: ok, reset, eof, timeout# Code - the HTTP transaction code, e.g., 200# Size - the size of the URL dataproc http::data {token} {    variable $token    upvar 0 $token state    return $state(body)}proc http::status {token} {    if {![info exists $token]} {return "error"    }    variable $token    upvar 0 $token state    return $state(status)}proc http::code {token} {    variable $token    upvar 0 $token state    return $state(http)}proc http::ncode {token} {    variable $token    upvar 0 $token state    if {[regexp {[0-9]{3}} $state(http) numeric_code]} {return $numeric_code    } else {return $state(http)    }}proc http::size {token} {    variable $token    upvar 0 $token state    return $state(currentsize)}proc http::meta {token} {    variable $token    upvar 0 $token state    return $state(meta)}proc http::error {token} {    variable $token    upvar 0 $token state    if {[info exists state(error)]} {return $state(error)    }    return ""}# http::cleanup##Garbage collect the state associated with a transaction## Arguments#tokenThe token returned from http::geturl## Side Effects#unsets the state arrayproc http::cleanup {token} {    variable $token    upvar 0 $token state    if {[info exists state]} {unset state    }}# http::Connect##This callback is made when an asyncronous connection completes.## Arguments#tokenThe token returned from http::geturl## Side Effects#Sets the status of the connection, which unblocks# the waiting geturl callproc http::Connect {token proto phost srvurl} {    variable $token    upvar 0 $token state    set err "due to unexpected EOF"    if {[eof $state(sock)] ||[set err [fconfigure $state(sock) -error]] ne ""    } then {Finish $token "connect failed $err"    } else {fileevent $state(sock) writable {}::http::Connected $token $proto $phost $srvurl    }    return}# http::Write##Write POST query data to the socket## Arguments#tokenThe token for the connection## Side Effects#Write the socket and handle callbacks.proc http::Write {token} {    variable $token    upvar 0 $token state    set sock $state(sock)    # Output a block.  Tcl will buffer this if the socket blocks    set done 0    if {[catch {# Catch I/O errors on dead socketsif {[info exists state(-query)]} {    # Chop up large query strings so queryprogress callback can give    # smooth feedback.    puts -nonewline $sock \[string range $state(-query) $state(queryoffset) \     [expr {$state(queryoffset) + $state(-queryblocksize) - 1}]]    incr state(queryoffset) $state(-queryblocksize)    if {$state(queryoffset) &gt;= $state(querylength)} {set state(queryoffset) $state(querylength)set done 1    }} else {    # Copy blocks from the query channel    set outStr [read $state(-querychannel) $state(-queryblocksize)]    puts -nonewline $sock $outStr    incr state(queryoffset) [string length $outStr]    if {[eof $state(-querychannel)]} {set done 1    }}    } err]} then {# Do not call Finish here, but instead let the read half of the socket# process whatever server reply there is to get.set state(posterror) $errset done 1    }    if {$done} {catch {flush $sock}fileevent $sock writable {}fileevent $sock readable [list http::Event $sock $token]    }    # Callback to the client after we've completely handled everything.    if {[string length $state(-queryprogress)]} {eval $state(-queryprogress) \    [list $token $state(querylength) $state(queryoffset)]    }}# http::Event##Handle input on the socket## Arguments#sockThe socket receiving input.#tokenThe token returned from http::geturl## Side Effects#Read the socket and handle callbacks.proc http::Event {sock token} {    variable $token    upvar 0 $token state    if {![info exists state]} {Log "Event $sock with invalid token '$token' - remote close?"if {![eof $sock]} {    if {[set d [read $sock]] ne ""} {Log "WARNING: additional data left on closed socket"    }}CloseSocket $sockreturn    }    if {$state(state) eq "connecting"} {if {[catch {gets $sock state(http)} n]} {    return [Finish $token $n]} elseif {$n &gt;= 0} {    set state(state) "header"}    } elseif {$state(state) eq "header"} {if {[catch {gets $sock line} n]} {    return [Finish $token $n]} elseif {$n == 0} {    # We have now read all headers    # We ignore HTTP/1.1 100 Continue returns. RFC2616 sec 8.2.3    if {$state(http) == "" || ([regexp {^\S+\s(\d+)} $state(http) {} x] &amp;&amp; $x == 100)} {return    }    set state(state) body    # If doing a HEAD, then we won't get any body    if {$state(-validate)} {Eof $tokenreturn    }    # For non-chunked transfer we may have no body - in this case we    # may get no further file event if the connection doesn't close    # and no more data is sent. We can tell and must finish up now -    # not later.    if {!(([info exists state(connection)]&amp;&amp; ($state(connection) eq "close"))    || [info exists state(transfer)])&amp;&amp; ($state(totalsize) == 0)    } then {Log "body size is 0 and no events likely - complete."Eof $tokenreturn    }    # We have to use binary translation to count bytes properly.    fconfigure $sock -translation binary    if {$state(-binary) || ![string match -nocase text* $state(type)]    } then {# Turn off conversions for non-text dataset state(binary) 1    }    if {$state(binary) || [string match *gzip* $state(coding)] ||[string match *compress* $state(coding)]    } then {if {[info exists state(-channel)]} {    fconfigure $state(-channel) -translation binary}    }    if {[info exists state(-channel)] &amp;&amp;![info exists state(-handler)]    } then {# Initiate a sequence of background fcopiesfileevent $sock readable {}CopyStart $sock $tokenreturn    }} elseif {$n &gt; 0} {    # Process header lines    if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} {switch -- [string tolower $key] {    content-type {set state(type) [string trim [string tolower $value]]# grab the optional charset informationif {[regexp -nocase \ {charset\s*=\s*\"((?:[^""]|\\\")*)\"} \ $state(type) -&gt; cs]} {    set state(charset) [string map {{\"} \"} $cs]} else {    regexp -nocase {charset\s*=\s*(\S+?);?} \$state(type) -&gt; state(charset)}    }    content-length {set state(totalsize) [string trim $value]    }    content-encoding {set state(coding) [string trim $value]    }    transfer-encoding {set state(transfer) \    [string trim [string tolower $value]]    }    proxy-connection -    connection {set state(connection) \    [string trim [string tolower $value]]    }}lappend state(meta) $key [string trim $value]    }}    } else {# Now reading bodyif {[catch {    if {[info exists state(-handler)]} {set n [eval $state(-handler) [list $sock $token]]    } elseif {[info exists state(transfer_final)]} {set line [getTextLine $sock]set n [string length $line]if {$n &gt; 0} {    Log "found $n bytes following final chunk"    append state(transfer_final) $line} else {    Log "final chunk part"    Eof $token}    } elseif {[info exists state(transfer)]&amp;&amp; $state(transfer) eq "chunked"    } then {set size 0set chunk [getTextLine $sock]set n [string length $chunk]if {[string trim $chunk] ne ""} {    scan $chunk %x size    if {$size != 0} {set bl [fconfigure $sock -blocking]fconfigure $sock -blocking 1set chunk [read $sock $size]fconfigure $sock -blocking $blset n [string length $chunk]if {$n &gt;= 0} {    append state(body) $chunk}if {$size != [string length $chunk]} {    Log "WARNING: mis-sized chunk:\was [string length $chunk], should be $size"}getTextLine $sock    } else {set state(transfer_final) {}    }}    } else {#Log "read non-chunk $state(currentsize) of $state(totalsize)"set block [read $sock $state(-blocksize)]set n [string length $block]if {$n &gt;= 0} {    append state(body) $block}    }    if {[info exists state]} {if {$n &gt;= 0} {    incr state(currentsize) $n}# If Content-Length - check for end of data.if {    ($state(totalsize) &gt; 0)    &amp;&amp; ($state(currentsize) &gt;= $state(totalsize))} then {    Eof $token}    }} err]} then {    return [Finish $token $err]} else {    if {[info exists state(-progress)]} {eval $state(-progress) \    [list $token $state(totalsize) $state(currentsize)]    }}    }    # catch as an Eof above may have closed the socket already    if {![catch {eof $sock} eof] &amp;&amp; $eof} {if {[info exists $token]} {    set state(connection) close    Eof $token} else {    # open connection closed on a token that has been cleaned up.    CloseSocket $sock}return    }}# http::getTextLine --##Get one line with the stream in blocking crlf mode## Arguments#sockThe socket receiving input.## Results:#The line of text, without trailing newlineproc http::getTextLine {sock} {    set tr [fconfigure $sock -translation]    set bl [fconfigure $sock -blocking]    fconfigure $sock -translation crlf -blocking 1    set r [gets $sock]    fconfigure $sock -translation $tr -blocking $bl    return $r}# http::CopyStart##Error handling wrapper around fcopy## Arguments#sockThe socket to copy from#tokenThe token returned from http::geturl## Side Effects#This closes the connection upon errorproc http::CopyStart {sock token} {    variable $token    upvar 0 $token state    if {[catch {fcopy $sock $state(-channel) -size $state(-blocksize) -command \    [list http::CopyDone $token]    } err]} then {Finish $token $err    }}# http::CopyDone##fcopy completion callback## Arguments#tokenThe token returned from http::geturl#countThe amount transfered## Side Effects#Invokes callbacksproc http::CopyDone {token count {error {}}} {    variable $token    upvar 0 $token state    set sock $state(sock)    incr state(currentsize) $count    if {[info exists state(-progress)]} {eval $state(-progress) \    [list $token $state(totalsize) $state(currentsize)]    }    # At this point the token may have been reset    if {[string length $error]} {Finish $token $error    } elseif {[catch {eof $sock} iseof] || $iseof} {Eof $token    } else {CopyStart $sock $token    }}# http::Eof##Handle eof on the socket## Arguments#tokenThe token returned from http::geturl## Side Effects#Clean up the socketproc http::Eof {token {force 0}} {    variable $token    upvar 0 $token state    if {$state(state) eq "header"} {# Premature eofset state(status) eof    } else {set state(status) ok    }    if {($state(coding) eq "gzip") &amp;&amp; [string length $state(body)] &gt; 0} {        if {[catch {    if {[package vsatisfies [package present Tcl] 8.6]} {# The zlib integration into 8.6 includes proper gzip supportset state(body) [zlib gunzip $state(body)]    } else {set state(body) [Gunzip $state(body)]    }        } err]} then {    return [Finish $token $err]        }    }    if {!$state(binary)} {        # If we are getting text, set the incoming channel's encoding        # correctly.  iso8859-1 is the RFC default, but this could be any IANA        # charset.  However, we only know how to convert what we have        # encodings for.        set enc [CharsetToEncoding $state(charset)]        if {$enc ne "binary"} {    set state(body) [encoding convertfrom $enc $state(body)]        }        # Translate text line endings.        set state(body) [string map {\r\n \n \r \n} $state(body)]    }    Finish $token}# http::wait --##See documentation for details.## Arguments:#tokenConnection token.## Results:#        The status after the wait.proc http::wait {token} {    variable $token    upvar 0 $token state    if {![info exists state(status)] || $state(status) eq ""} {# We must wait on the original variable name, not the upvar aliasvwait ${token}(status)    }    return [status $token]}# http::formatQuery --##See documentation for details.  Call http::formatQuery with an even#number of arguments, where the first is a name, the second is a value,#the third is another name, and so on.## Arguments:#argsA list of name-value pairs.## Results:#TODOproc http::formatQuery {args} {    set result ""    set sep ""    foreach i $args {append result $sep [mapReply $i]if {$sep eq "="} {    set sep &amp;} else {    set sep =}    }    return $result}# http::mapReply --##Do x-www-urlencoded character mapping## Arguments:#stringThe string the needs to be encoded## Results:#       The encoded stringproc http::mapReply {string} {    variable http    variable formMap    # The spec says: "non-alphanumeric characters are replaced by '%HH'". Use    # a pre-computed map and [string map] to do the conversion (much faster    # than [regsub]/[subst]). [Bug 1020491]    if {$http(-urlencoding) ne ""} {set string [encoding convertto $http(-urlencoding) $string]return [string map $formMap $string]    }    set converted [string map $formMap $string]    if {[string match "*\[\u0100-\uffff\]*" $converted]} {regexp {[\u0100-\uffff]} $converted badChar# Return this error message for maximum compatability... :^/return -code error \    "can't read \"formMap($badChar)\": no such element in array"    }    return $converted}# http::ProxyRequired --#Default proxy filter.## Arguments:#hostThe destination host## Results:#       The current proxy settingsproc http::ProxyRequired {host} {    variable http    if {[info exists http(-proxyhost)] &amp;&amp; [string length $http(-proxyhost)]} {if {    ![info exists http(-proxyport)] ||    ![string length $http(-proxyport)]} then {    set http(-proxyport) 8080}return [list $http(-proxyhost) $http(-proxyport)]    }}# http::CharsetToEncoding --##Tries to map a given IANA charset to a tcl encoding.  If no encoding#can be found, returns binary.#proc http::CharsetToEncoding {charset} {    variable encodings    set charset [string tolower $charset]    if {[regexp {iso-?8859-([0-9]+)} $charset -&gt; num]} {set encoding "iso8859-$num"    } elseif {[regexp {iso-?2022-(jp|kr)} $charset -&gt; ext]} {set encoding "iso2022-$ext"    } elseif {[regexp {shift[-_]?js} $charset]} {set encoding "shiftjis"    } elseif {[regexp {(?:windows|cp)-?([0-9]+)} $charset -&gt; num]} {set encoding "cp$num"    } elseif {$charset eq "us-ascii"} {set encoding "ascii"    } elseif {[regexp {(?:iso-?)?lat(?:in)?-?([0-9]+)} $charset -&gt; num]} {switch -- $num {    5 {set encoding "iso8859-9"}    1 - 2 - 3 {set encoding "iso8859-$num"    }}    } else {# other charset, like euc-xx, utf-8,...  may directly map to encodingset encoding $charset    }    set idx [lsearch -exact $encodings $encoding]    if {$idx &gt;= 0} {return $encoding    } else {return "binary"    }}# http::Gunzip --##Decompress data transmitted using the gzip transfer coding.## FIX ME: redo using zlib sinflateproc http::Gunzip {data} {    binary scan $data Scb5icc magic method flags time xfl os    set pos 10    if {$magic != 0x1f8b} {        return -code error "invalid data: supplied data is not in gzip format"    }    if {$method != 8} {        return -code error "invalid compression method"    }    # lassign [split $flags ""] f_text f_crc f_extra f_name f_comment    foreach {f_text f_crc f_extra f_name f_comment} [split $flags ""] break    set extra ""    if {$f_extra} {binary scan $data @${pos}S xlen        incr pos 2        set extra [string range $data $pos $xlen]        set pos [incr xlen]    }    set name ""    if {$f_name} {        set ndx [string first \0 $data $pos]        set name [string range $data $pos $ndx]        set pos [incr ndx]    }    set comment ""    if {$f_comment} {        set ndx [string first \0 $data $pos]        set comment [string range $data $pos $ndx]        set pos [incr ndx]    }    set fcrc ""    if {$f_crc} {set fcrc [string range $data $pos [incr pos]]        incr pos    }    binary scan [string range $data end-7 end] ii crc size    set inflated [zlib inflate [string range $data $pos end-8]]    set chk [zlib crc32 $inflated]    if {($crc &amp; 0xffffffff) != ($chk &amp; 0xffffffff)} {return -code error "invalid data: checksum mismatch $crc != $chk"    }    return $inflated}# Local variables:# indent-tabs-mode: t# End:</code></pre></div><span style="color:brown">and tcl of json</span><br><br><a href="http://www.geocities.ws/mirczn/json.tcl" class="postlink">json.tcl</a><br>these three add tcl in the conf:<br>      source scripts/http.tcl<br>      source scripts/json.tcl<br><br>Once done all those steps turn off your bot and turn it on again do not run the rehash<br>I recommend you use version 1.6.20 is the most stable and without many errors<br>Version 1.8. Is full of errors<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Tue Aug 01, 2017 8:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[taxick]]></name></author>
		<updated>2017-07-29T05:27:16-04:00</updated>

		<published>2017-07-29T05:27:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106390#p106390</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106390#p106390"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106390#p106390"><![CDATA[
Hi,<br><br>It's okay! I hope someone else can help me with this problem!?<br><br>Thanks for trying CP1832 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9146">taxick</a> — Sat Jul 29, 2017 5:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2017-07-28T16:57:47-04:00</updated>

		<published>2017-07-28T16:57:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106389#p106389</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106389#p106389"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106389#p106389"><![CDATA[
<blockquote class="uncited"><div>So the versions shut be fine  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> Any ide what it can be?</div></blockquote>I'm out of clues, I don't have that much tcl knowledge... Sorry.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Fri Jul 28, 2017 4:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[taxick]]></name></author>
		<updated>2017-07-28T13:51:42-04:00</updated>

		<published>2017-07-28T13:51:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106388#p106388</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106388#p106388"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106388#p106388"><![CDATA[
Hi,<br><br>Thanks for trying helping me out! Here are my output:<br><div class="codebox"><p>Code: </p><pre><code>ircd@server:/home/ircd# tclsh% package require tls1.6.7% package require http2.8.9% package require json1.3.3% package require htmlparse1.2.2%</code></pre></div>So the versions shut be fine  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> Any ide what it can be?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9146">taxick</a> — Fri Jul 28, 2017 1:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2017-07-28T13:42:08-04:00</updated>

		<published>2017-07-28T13:42:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106387#p106387</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106387#p106387"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106387#p106387"><![CDATA[
<blockquote class="uncited"><div>Hi CP1832, thanks for you reply.<br><br>I did try to compile the eggdrop again with this command:<br><div class="codebox"><p>Code: </p><pre><code>./configure --with-tcllib=/usr/lib64/libtcl8.6.so --with-tclinc=/usr/include/tcl.h --enable-tls=/usr/include/tls.h</code></pre></div>and I getting this: <br><div class="codebox"><p>Code: </p><pre><code>Operating System: Linux 4.9.15-x86_64-linode81IPv6 Support: yesTcl version: 8.6.6 (threaded)SSL/TLS Support: yes (OpenSSL 1.0.2g  1 Mar 2016)</code></pre></div></div></blockquote>Hi taxkick, in your shell type:<div class="codebox"><p>Code: </p><pre><code>me@shell:~$ tclsh% package require tls           1.6% package require http2.8.8% package require json 1.3.2% package require htmlparse1.2.1</code></pre></div>And check all the google.tcl required packages...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Fri Jul 28, 2017 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[taxick]]></name></author>
		<updated>2017-07-27T18:08:26-04:00</updated>

		<published>2017-07-27T18:08:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106385#p106385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106385#p106385"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106385#p106385"><![CDATA[
Hi CP1832, thanks for you reply.<br><br>I did try to compile the eggdrop again with this command:<br><div class="codebox"><p>Code: </p><pre><code>./configure --with-tcllib=/usr/lib64/libtcl8.6.so --with-tclinc=/usr/include/tcl.h --enable-tls=/usr/include/tls.h</code></pre></div>and I getting this: <br><div class="codebox"><p>Code: </p><pre><code>Operating System: Linux 4.9.15-x86_64-linode81IPv6 Support: yesTcl version: 8.6.6 (threaded)SSL/TLS Support: yes (OpenSSL 1.0.2g  1 Mar 2016)</code></pre></div>But it still not work for me<br><br>More ides???<br><br>EDIT: <br><br>Here are the loaded modules: <br><br>source scripts/http.tcl<br>source scripts/json.tcl<br>source scripts/htmlparse.tcl<br>source scripts/url.tcl<br>source scripts/google.tcl<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9146">taxick</a> — Thu Jul 27, 2017 6:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2017-07-26T09:40:37-04:00</updated>

		<published>2017-07-26T09:40:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106382#p106382</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106382#p106382"/>
		<title type="html"><![CDATA[Re: google]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106382#p106382"><![CDATA[
Hi taxkick, it looks like your eggdrop doesn't support one of the protocols required for this script to run. Maybe it doesn't support tls?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Wed Jul 26, 2017 9:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[taxick]]></name></author>
		<updated>2017-07-25T14:51:14-04:00</updated>

		<published>2017-07-25T14:51:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106381#p106381</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106381#p106381"/>
		<title type="html"><![CDATA[Re: google]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106381#p106381"><![CDATA[
Hi.<br><br>I have followed your guide, but I get this error when i type "!google superman"<br><blockquote class="uncited"><div>Google Timeout connecting to Google: protocol not supported</div></blockquote>I'm running eggdrop 1.8.1 and I'm on Ubuntu 17.04<br><br>I have inserted my own keys, by following this guide: <a href="https://www.imarc.com/blog/google-custom-search" class="postlink">https://www.imarc.com/blog/google-custom-search</a><br><br>Hope you can help me out here<br><br>EDIT: I have try to turn my firewall off, and it doesn't help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9146">taxick</a> — Tue Jul 25, 2017 2:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2021-11-18T03:27:09-04:00</updated>

		<published>2017-06-04T17:28:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=106309#p106309</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=106309#p106309"/>
		<title type="html"><![CDATA[google]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=106309#p106309"><![CDATA[
<span style="color:brown">Solved</span><br><span style="color:blue">This tcl for its correct functioning requires the following</span><br><br><span style="color:orange">in eggdrop</span><br><strong class="text-strong">step 1</strong><br>conf down and add in two tcl:<br><a href="http://www.geocities.ws/mirczn/http.tcl" class="postlink">http.tcl</a><br><a href="http://www.geocities.ws/mirczn/json.tcl" class="postlink">json.tcl</a><br><br>these three add tcl in the conf:<br>      source scripts/http.tcl<br>      source scripts/json.tcl<br><br><span style="color:blue">in windrop</span><br><strong class="text-strong">step 1</strong><br>conf down and add in three tcl:<br><a href="http://www.geocities.ws/mirczn/http.tcl" class="postlink">http.tcl</a><br><a href="http://www.geocities.ws/mirczn/tls.tcl" class="postlink">tls.tcl</a><br><a href="http://www.geocities.ws/mirczn/json.tcl" class="postlink">json.tcl</a><br><br>these three add tcl in the conf:<br>      source scripts/http.tcl<br>      source scripts/tls.tcl<br>      source scripts/json.tcl <br><br><strong class="text-strong">step two</strong><br><strong class="text-strong">then down</strong><br><a href="https://sourceforge.net/projects/tls/files/tls/1.6/tls1.6-win32.zip/download?use_mirror=liquidtelecom&amp;r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ftls%2F&amp;use_mirror=hivelocity" class="postlink">tls lib</a><br><strong class="text-strong">unzip the contents and paste in your directory</strong>.  example;<br> \lib\tcl8.5<br><br>and that's all ready, will be working well...<br><div class="codebox"><p>Code: </p><pre><code>################################################################################################  ## Advanced Google.tcl for eggdrop by CP1832 &amp; Arnold_X-P network: DALnet irc.dal.net channel #tcls################################################################################################  ## To use this script you must set channel flag +google (ie .chanset #chan +google) ##  ################################################################################################## This tcl requires the following in eggdrop: http.tcl json.tcl #### This tcl requires the following in windrop: http.tcl json.tcl tls.tcl ##package require httppackage require jsonif {[catch {package require tls}]} {set httpsSupport false} else {set httpsSupport true}set url "www.googleapis.com/customsearch/v1?"if {$httpsSupport} {::http::register https 443 [list ::tls::socket -request 1 -require 0 -ssl3 1 -tls1 1]set url https://$url} else { set url http://$url }################################################################################################  ##                             Start Setup.                                         ##  ################################################################################################## Change the country code between the "" below to change the language of your results.     ##set googlectry "en"## Change the number between the "" below to change the number of results returned.         ##set googlemax "3"set googlelogo "12G4o7o12g3l4e"## google api ###you must create a key for your google search engine in https://cloud.google.com/docs/authentication/api-keys?visit_id=637728160970526198-325218571&amp;rd=1 #creating_an_api_key# set API_KEY "your-api-key" set SEARCH_ID "your-id"################################################################################################  ##                           End Setup.                                              ## ################################################################################################set gaucho "CP1832 &amp; Arnold_X-P"set googlever "v3.0.0"setudef flag googleproc googleweb {nick host hand chan type search} {      global googlectry googlemax API_KEY SEARCH_ID url googlelogo      if {![channel get $chan google]} {return}      if {$search == ""} {puthelp "PRIVMSG $chan :Error: &lt;search&gt; is empty"; return 1 }      if {$type == ""} {   set googleurl $url[::http::formatQuery alt json key $API_KEY cx $SEARCH_ID hl $googlectry q $search]   } else { set googleurl $url[::http::formatQuery alt json key $API_KEY cx $SEARCH_ID hl $googlectry q $search searchType $type] }      if {[catch {http::geturl $googleurl -timeout 5000} sockerr]} {         puthelp "privmsg $chan :$googlelogo Timeout connecting to Google: $sockerr"         return 1      } elseif {[http::ncode $sockerr] != 200 || ![string equal [http::status $sockerr] "ok"]} {         puthelp "privmsg $chan :$googlelogo Error querying Google: [http::ncode $sockerr] -&gt; [http::status $sockerr]"         http::cleanup $sockerr         return 1      } else {         set data [http::data $sockerr]         http::cleanup $sockerr         set json [ ::json::json2dict $data ]         for { set i 0 } { $i &lt; $googlemax } { incr i } {            set title ""            set link ""            catch { set title [ dict get [ lindex [ dict get $json items ] $i ] title ] }            catch { set link  [ dict get [ lindex [ dict get $json items ] $i ] link ] }            set index [ expr $i + 1 ]            if {[string length $title] &amp;&amp; [string length $link]} {               putserv "PRIVMSG $chan :$googlelogo $title $link"            } else {               puthelp "PRIVMSG $chan :$googlelogo found no results"            }         }      }return 1}proc google {nick host hand chan text} { googleweb $nick $host $hand $chan "" $text}proc gimage {nick host hand chan text} { googleweb $nick $host $hand $chan image $text}foreach bind [binds google] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}foreach bind [binds gimage] {lassign $bind type flags mask num proc; unbind $type $flags $mask $proc}bind pub - .google googlebind pub - !google googleputlog "Google search loaded by $gaucho $googlever" </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Sun Jun 04, 2017 5:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2016-09-28T10:44:04-04:00</updated>

		<published>2016-09-28T10:44:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105465#p105465</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105465#p105465"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105465#p105465"><![CDATA[
<blockquote class="uncited"><div>try a lot of forms and I cannot create an api for the searcher google<br>use manuals and the same happens to me ..<br><br>someone can prepare a manual of as to create an api for search in google</div></blockquote>Hi Arnold_X-P, I found the manual I used to create my google search API: <a href="https://www.imarc.com/blog/google-custom-search" class="postlink">https://www.imarc.com/blog/google-custom-search</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Wed Sep 28, 2016 10:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2016-09-24T11:43:11-04:00</updated>

		<published>2016-09-24T11:43:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105462#p105462</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105462#p105462"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105462#p105462"><![CDATA[
try a lot of forms and I cannot create an api for the searcher google<br>use manuals and the same happens to me ..<br><br>someone can prepare a manual of as to create an api for search in google<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Sat Sep 24, 2016 11:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CP1832]]></name></author>
		<updated>2016-07-01T15:59:52-04:00</updated>

		<published>2016-07-01T15:59:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105225#p105225</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105225#p105225"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105225#p105225"><![CDATA[
<blockquote class="uncited"><div>CP1832., this tcl does not work and does not seek<br>just launch this and never looking:<br><br>&lt;@Arnold_X-P&gt; .google mirc<br>&lt;@JulieTh&gt; Error querying Google: 403 -&gt; ok<br><br>&lt;@Arnold_X-P&gt; .google irc<br>&lt;@JulieTh&gt; Error querying Google: 400 -&gt; ok<br><br>and believes the current account and does not work tcl<br><br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"></div></blockquote>Hi Arnold, that error is caused due to having a wrong API key or search ID. I have them right and the bot answers every query perfectly.<div class="codebox"><p>Code: </p><pre><code>(2016-07-01 16:52:04) CP1832: .google mcgyver eggdrop(2016-07-01 16:52:06) Eggdrop: How to Build an Egg Drop Container with Straws | Egg Drop, Straws ... https://www.pinterest.com/pin/484066659919400998/(2016-07-01 16:56:19) CP1832: .google stone roses this is the one(2016-07-01 16:56:21) Eggdrop: The Stone Roses - This Is The One - YouTube https://www.youtube.com/watch?v=-aqY-8cMVdg</code></pre></div>I edited the script and entered wrong API keys and started getting 400 errors as you are.<div class="codebox"><p>Code: </p><pre><code>(2016-07-01 16:50:20) CP1832: .google mirc(2016-07-01 16:50:22) Eggdrop: Error querying Google: 400 -&gt; ok</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12450">CP1832</a> — Fri Jul 01, 2016 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2016-07-01T13:08:34-04:00</updated>

		<published>2016-07-01T13:08:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105224#p105224</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105224#p105224"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105224#p105224"><![CDATA[
CP1832., this tcl does not work and does not seek<br>just launch this and never looking:<br><br>&lt;@Arnold_X-P&gt; .google mirc<br>&lt;@JulieTh&gt; Error querying Google: 403 -&gt; ok<br><br>&lt;@Arnold_X-P&gt; .google irc<br>&lt;@JulieTh&gt; Error querying Google: 400 -&gt; ok<br><br>and believes the current account and does not work tcl<br><br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Fri Jul 01, 2016 1:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2016-06-29T19:12:42-04:00</updated>

		<published>2016-06-29T19:12:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105222#p105222</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105222#p105222"/>
		<title type="html"><![CDATA[TCL of google no longer works .. By FordLawnmower]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105222#p105222"><![CDATA[
someone who teaches me google api register an account to use this tcl<br>someone who teaches me google api register an account to use this tcl<br><br><br>look manuals but there is not one clear that teaches detail<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cry.gif" width="15" height="15" alt=":cry:" title="Crying or Very sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Wed Jun 29, 2016 7:12 pm</p><hr />
]]></content>
	</entry>
	</feed>
