<?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/9554" />

	<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>2005-06-08T14:35:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-06-08T14:35:13-04:00</updated>

		<published>2005-06-08T14:35:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50423#p50423</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50423#p50423"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50423#p50423"><![CDATA[
no, he mussn't.<br><br>here is the error:<br>if {[$deediv == "o"]} { <br><br>dont use [] around such an expression, this will try to call the content of the var as a function with the argument '== "o"' and triing to handle return value as boolan.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Jun 08, 2005 2:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kanibus]]></name></author>
		<updated>2005-06-04T20:31:27-04:00</updated>

		<published>2005-06-04T20:31:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50247#p50247</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50247#p50247"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50247#p50247"><![CDATA[
could if be the [info exists deediv] should i put a $ in front of deediv?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6186">kanibus</a> — Sat Jun 04, 2005 8:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kanibus]]></name></author>
		<updated>2005-06-03T18:16:37-04:00</updated>

		<published>2005-06-03T18:16:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50171#p50171</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50171#p50171"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50171#p50171"><![CDATA[
i tried to add some more functionality but it gives me a tcl error saying that the value of deediv isnt a command, like say deediv was "m" it says <blockquote class="uncited"><div> Tcl error [steam_query]: invalid command name "m"</div></blockquote><div class="codebox"><p>Code: </p><pre><code>set cztrig .czlidbind PUB -|- $cztrig steam_queryproc steam_query { nick host hand chan text } {        if { [string match "" "$text"] } {                putserv "NOTICE $nick :usage: .czlid &lt;steamid&gt;      example: .czlid 0:1:2345"        } else {        search_id $nick "czleague.org/index.php?div=&amp;action=steamidsearch&amp;submit=1" $text        }}proc search_id {ic url string} {        global dateem deediv dateam idee        set dateem ""        set dateam ""        set deediv ""        ::http::config -useragent "Kanibus's CZLid Search"        set czid [::http::formatQuery steamid $string]        if {[catch {set tok [::http::geturl $url -query $czid]} error]} {                set text "An error occured while connecting to the CZL database."                putserv "NOTICE $ic :$text"                return        }        if {[::http::ncode $tok] != 200} {                set text "An error occured while connecting to the CZL database."                putserv "NOTICE $ic :$text"                ::http::cleanup $tok ; return        }        set undata [::http::data $tok]        regexp {&lt;a href="index.php\?div=&amp;action=viewuser&amp;id=([0-9]*)"&gt;View&lt;/a&gt;&lt;/td&gt;} $undata - idee        set turl "czleague.org/index.php?div=&amp;action=viewuser&amp;id=$idee"        if {[info exists idee]} {        if {[catch {set tak [::http::geturl $turl]} error]} {                set dateam "unavailible"                return              }        if {[::http::ncode $tak] != 200} {                set dateam "unavailible"                ::http::cleanup $tak ; return        }        set ttdata [::http::data $tak]        regexp {&lt;a href="index.php\?div=czl(.*)&amp;action=viewteam&amp;id=([0-9]*)"&gt;(.*)&lt;/a&gt;} $ttdata - deediv deeeideee dateem        if {[info exists dateem]} {        global deediv        if {[info exists deediv]} {        if {[$deediv == "o"]} {        set saydiv "(open)"        } elseif {[$deediv == "m"]} {        set saydiv "(main)"        } elseif {[$deediv == "i"]} {        set saydiv "(invite)"        } else {        set saydiv ""         }        }        set dateam [html2text $dateem]        ::http::cleanup $tak        } else {        set dateem "Clanless"        set dateam "Clanless"        }        } else {        set dateam "unavailible"        }        set data [html2text $undata]        set dalist [split $data \n]        set first [lsearch $dalist Alias]        set second $first        incr first 4        incr second 7        set results [lrange $dalist $first $second]        set daid [lindex $results 0]        set daname [lindex $results 1]        set lastname [lindex $results 2]  set daalias [lindex $results 3]        if {$dateam == "" } { set dateam "Clanless" }        if {$daid == "" } {        set text "\0037,1\037S\037\0030,1orry, that id was not found in the database."        } else {        set text "Steam id: $daid · Name: $daname $lastname · Alias: $daalias · Team: $dateam $saydiv"    }        putserv "NOTICE $ic :$text"        ::http::cleanup $tok ; return}proc html2text {text} {        regsub -all {&lt;.*?&gt;}  $text {}    text        regsub -all { } $text { }   text        regsub -all {&lt;}   $text {&lt;}   text        regsub -all {&gt;}   $text {&gt;}   text        regsub -all {"} $text {\\"} text        regsub -all {'}  $text {'}   text        regsub -all {[}  $text {\\[} text        regsub -all {]}  $text {\\]} text        regsub -all {©} $text {©}   text        regsub -all {&amp;}  $text {&amp;}   text        return $text}putlog "czl.tcl - steam id lookup - kanibus(rbrady0819@yahoo.com)"</code></pre></div>why is it trying to use the value of deediv as a command? i dont see when i am calling it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6186">kanibus</a> — Fri Jun 03, 2005 6:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kanibus]]></name></author>
		<updated>2005-05-05T04:42:31-04:00</updated>

		<published>2005-05-05T04:42:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49033#p49033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49033#p49033"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49033#p49033"><![CDATA[
thanks again for your help, here is the finished product:<div class="codebox"><p>Code: </p><pre><code>set cztrig .czlidbind PUB -|- $cztrig steam_queryproc steam_query { nick host hand chan text } {        if { [string match "" "$text"] } {                putserv "NOTICE $nick :usage: .czlid &lt;steamid&gt;      example: .czlid 0:1:2345"        } else {        search_id $nick "czleague.org/index.php?div=&amp;action=steamidsearch&amp;submit=1" $text        }}proc search_id {ic url string} {        ::http::config -useragent "Kanibus's CZLid Search"        set czid [::http::formatQuery steamid $string]        if {[catch {set tok [::http::geturl $url -query $czid]} error]} {                set text "An error occured while connecting to the CZL database."                putserv "NOTICE $ic :$text"                return        }        if {[::http::ncode $tok] != 200} {                set text "An error occured while connecting to the CZL database."                putserv "NOTICE $ic :$text"                ::http::cleanup $tok ; return        }        set data [html2text [::http::data $tok]]        set dalist [split $data \n]        set first [lsearch $dalist Alias]        set second $first        incr first 4        incr second 7        set results [lrange $dalist $first $second]        set daid [lindex $results 0]        set daname [lindex $results 1]        set lastname [lindex $results 2]        set daalias [lindex $results 3]        #set resfile "/home/kanibus/eggdrop/scripts/search.results"        #set fx [open $resfile w]        #puts $fx "$results"        #close $fx        set text "\0037,1\037S\037\0030,1team id:\0037,1 $daid \0030,1· \0037,1\037N\037\0030,1ame:\0037,1 $daname $lastname \0030,1· \0037,1\037A\037\0030,1li        putserv "NOTICE $ic :$text"        ::http::cleanup $tok ; return}proc html2text {text} {        regsub -all {&lt;.*?&gt;}  $text {}    text        regsub -all { } $text { }   text        regsub -all {&lt;}   $text {&lt;}   text        regsub -all {&gt;}   $text {&gt;}   text        regsub -all {"} $text {\\"} text        regsub -all {'}  $text {'}   text        regsub -all {[}  $text {\\[} text        regsub -all {]}  $text {\\]} text        regsub -all {©} $text {©}   text        regsub -all {&amp;}  $text {&amp;}   text        return $text}putlog "czl.tcl - steam id lookup - kanibus(rbrady0819@yahoo.com)"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6186">kanibus</a> — Thu May 05, 2005 4:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-05-04T17:32:31-04:00</updated>

		<published>2005-05-04T17:32:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=49012#p49012</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=49012#p49012"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=49012#p49012"><![CDATA[
you want to split each line input an element of a list?<br>then use: [split $data \n]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed May 04, 2005 5:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kanibus]]></name></author>
		<updated>2005-05-04T07:47:18-04:00</updated>

		<published>2005-05-04T07:47:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48971#p48971</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48971#p48971"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48971#p48971"><![CDATA[
thanks a lot for your help. i got it writing to the file, but i am having trouble parsing this. is there a way i could add these items to a list by line? i tried  [split $data &gt;] )to split it after the &gt; character without using the htlm2tect proc)and that didnt work so if i can just do it by line in a list than search that list for the strings, but ive cant figure out how. thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6186">kanibus</a> — Wed May 04, 2005 7:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-05-03T19:11:58-04:00</updated>

		<published>2005-05-03T19:11:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48961#p48961</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48961#p48961"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48961#p48961"><![CDATA[
if any TCL error occur you can see them in $errorInfo (usually: .set errorInfo).<br>if it doesnt write anything, then it doesnt come so far ^-^.<br>I have often used similar codes to save the html code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 03, 2005 7:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kanibus]]></name></author>
		<updated>2005-05-03T18:54:35-04:00</updated>

		<published>2005-05-03T18:54:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48959#p48959</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48959#p48959"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48959#p48959"><![CDATA[
ahh woops good eye on that one, is ther a way to do something like debugging where i can see if the bot is getting hung up on the post or where it gets stuck beacuse there are no errors in the logs but yet it doesnt return anything. i tried to do the following to get $data written to a text file so i will be able to parse it, without luck.<div class="codebox"><p>Code: </p><pre><code>        set resfile "/home/luser/eggdrop/scripts/search.results"        set fx [open $resfile w]        puts $fx "$data"        close $fx</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6186">kanibus</a> — Tue May 03, 2005 6:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-05-03T08:10:46-04:00</updated>

		<published>2005-05-03T08:10:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48943#p48943</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48943#p48943"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48943#p48943"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># http::formatQuery --##See documentaion 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:#        TODO</code></pre></div>seems you have to rather use<div class="codebox"><p>Code: </p><pre><code>set czid [::http::formatQuery steamid $string]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 03, 2005 8:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kanibus]]></name></author>
		<updated>2005-05-03T10:24:32-04:00</updated>

		<published>2005-05-03T07:30:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48939#p48939</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48939#p48939"/>
		<title type="html"><![CDATA[id lookup with HTTP POST]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48939#p48939"><![CDATA[
hello, i am trying to write something that will use an id lookup on <a href="http://www.czleague.org" class="postlink">www.czleague.org</a> and display the results in the chat, at the request of a user. a POST request to<br>index.php?div=&amp;action=steamidsearch&amp;submit=1 with one argument as steamid is required.<div class="codebox"><p>Code: </p><pre><code>set cztrig .czlidbind PUB -|- $cztrig steam_queryproc steam_query { nick host hand chan text } {        if { [string match "" "$text"] } {                putserv "NOTICE $nick :usage: .czlid &lt;steamid&gt;      example: .czlid 0:1:2345"        } else {        search_id $nick "czleague.org/index.php?div=&amp;action=steamidsearch&amp;submit=1" $text        }}proc search_id {ic url string} {        ::http::config -useragent "Kanibus's CZLid Search"        set czid [::httpformatQuery:: steamid $string]        if {[catch {set tok [::http::geturl $url -query $czid]} error]} {                set text "An error occured while connecting to the CZL database."                putserv "NOTICE $ic :$text"                return        }        if {[::http::ncode $tok] != 200} {                set text "An error occured while connecting to the CZL database."                putserv "NOTICE $ic :$text"                ::http::cleanup $tok ; return        }        set data [html2text [::http::data $tok]]       ###PARSE HERE??###        set text "results here"        putserv "NOTICE $ic :$text"        ::http::cleanup $tok ; return}proc html2text {text} {        regsub -all {&lt;.*?&gt;}  $text {}    text        regsub -all { } $text { }   text        regsub -all {&lt;}   $text {&lt;}   text        regsub -all {&gt;}   $text {&gt;}   text        regsub -all {"} $text {\\"} text        regsub -all {'}  $text {'}   text        regsub -all {[}  $text {\\[} text        regsub -all {]}  $text {\\]} text        regsub -all {©} $text {©}   text        regsub -all {&amp;}  $text {&amp;}   text        return $text}putlog "czl.tcl - steam id lookup - kanibus(rbrady0819@yahoo.com)" </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6186">kanibus</a> — Tue May 03, 2005 7:30 am</p><hr />
]]></content>
	</entry>
	</feed>
