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

	<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>2006-05-02T09:04:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[NTHosts]]></name></author>
		<updated>2006-05-02T09:04:40-04:00</updated>

		<published>2006-05-02T09:04:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62576#p62576</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62576#p62576"/>
		<title type="html"><![CDATA[...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62576#p62576"><![CDATA[
DOH !!<br><br>/me slaps his forehead <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6839">NTHosts</a> — Tue May 02, 2006 9:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-05-02T08:31:58-04:00</updated>

		<published>2006-05-02T08:31:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62574#p62574</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62574#p62574"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62574#p62574"><![CDATA[
load egghttp before google?! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Tue May 02, 2006 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[NTHosts]]></name></author>
		<updated>2006-05-02T07:28:34-04:00</updated>

		<published>2006-05-02T07:28:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=62573#p62573</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=62573#p62573"/>
		<title type="html"><![CDATA[ummm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=62573#p62573"><![CDATA[
Hi, just tried to use this script but keep getting this error on rehash <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":-(" title="Sad"><br><br> [06:25] Could not verify egghttp.tcl beeing loaded! Failed to load google.<br><br>any ideas ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6839">NTHosts</a> — Tue May 02, 2006 7:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-03-18T09:47:22-04:00</updated>

		<published>2005-03-18T09:47:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47845#p47845</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47845#p47845"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47845#p47845"><![CDATA[
<blockquote class="uncited"><div>yeah better copy all and change it or you can make as tcl release for everybody to use , i interesting in this tcl too  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"></div></blockquote><blockquote class="uncited"><div>Posted: Today at <strong class="text-strong">3:19 am</strong> Reply with quoteEdit/Delete this postBack to top<br>stupid regex, ...</div></blockquote><blockquote class="uncited"><div>Last edited by De Kus on Fri Mar 18, 2005 <strong class="text-strong">3:20 am</strong>; edited 1 time in total</div></blockquote>maybe I have already updated the <a href="http://forum.egghelp.org/viewtopic.php?p=47808#47808" class="postlink">previous post</a>?!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Fri Mar 18, 2005 9:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cambodia]]></name></author>
		<updated>2005-03-18T02:58:46-04:00</updated>

		<published>2005-03-18T02:58:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47832#p47832</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47832#p47832"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47832#p47832"><![CDATA[
yeah better copy all and change it or you can make as tcl release for everybody to use , i interesting in this tcl too  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5351">cambodia</a> — Fri Mar 18, 2005 2:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-03-17T22:19:03-04:00</updated>

		<published>2005-03-17T22:19:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47820#p47820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47820#p47820"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47820#p47820"><![CDATA[
stupid regex, the gimmi a headache. but finally I know how to corectly prevent multiline matching, so the best regexp is:<br><br>regexp {(?n)&lt;a href=\"(.*)\"&gt;} [egghttp:data $token] {} newurl<br><br>file<strong class="text-strong">mirror</strong> is intended to be used for searching an alternitive server (so Ill probably add a feature to get something else than mirror #1) and not a file search. for a file search your are better with !google <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">.<br><br>PS: I replaced the code above, better copy completly, because I added a [split ] to where llengeth is used.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Mar 17, 2005 10:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-17T21:38:51-04:00</updated>

		<published>2005-03-17T21:38:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47816#p47816</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47816#p47816"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47816#p47816"><![CDATA[
<a href="ftp://ftp.nero.com/Nero-6.6.0.8a.exe%22%3ENero-6.6.0.8a.exe%3C/a%3E%3Cbr" class="postlink">ftp://ftp.nero.com/Nero-6.6.0.8a.exe"&gt;N ... exe&lt;/a&gt;&lt;br</a>&gt;<br><br>for example... is the result for the search of Nero-6.6.0.8a.exe!<br>so something must be wrong... but it works... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Anyway, why can't one search just "nero"? if one does that no results are shown... do I need to use the full name to search it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Thu Mar 17, 2005 9:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-24T18:05:51-04:00</updated>

		<published>2005-03-17T20:07:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47808#p47808</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47808#p47808"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47808#p47808"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># De Kus' google port from http to egghttp## 1.2.1 18.03.2005 regexp for !file rewritten, fixed remote code execution# 1.2.0 18.03.2005 !file rewrote done# 1.1.1 25.02.2005 fixed remote code execution from $nick# 1.1.0 25.02.2005 !image rewrote done# 1.0.1 24.02.2005 changed query string creation# 1.0.0 24.02.2005 rewrote done##following orignal header:## google.tcl v0.2.1## !google keywords - displays the first related website found from google in the channel# !image keywords  - displays the first related image found on google in the channel# !file keywords   - displays the first mirror download link found on filemirrors in the channel## by aNa|0Gue - analogue@glop.org - http://www.glop.org/## 04/17/2002 v0.2.1 useragent fix by FANif { ![info exists egghttp(version)] } {putlog "Could not verify egghttp.tcl beeing loaded! Failed to load google."} else {# close bracet extra documentatedbind pub - !google pub:google:cmdbind pub - !image pub:image:cmdbind pub - !file pub:file:cmd# with this we avoid using the syncronous gethostbyname with CONNECT in egghttpdnslookup www.google.de getgoogledns:cbdnslookup www.filemirrors.com getfmdns:cbproc getgoogledns:cb {ip host status} {set ::googleip $ip }proc getfmdns:cb {ip host status} {set ::fmip $ip }set googleflood 0proc pub:google:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan google $argreturn 1}proc pub:image:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan image $argreturn 1}proc pub:file:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan file $argreturn 1}proc pub:google {nick uhost handle chan type arg} {global googlefloodif { $googleflood &gt; 4 } {puthelp "NOTICE $nick :Genug gesucht erstmal."return 0} elseif { $::googleip == "0.0.0.0" || $::fmip == "0.0.0.0" } {puthelp "NOTICE $nick :Sorry, I don't have the cached IPs. If this persists DNS lookup is broken. Requesting now..."dnslookup www.google.de getgoogledns:cbdnslookup www.filemirrors.com getfmdns:cbreturn 0}incr googlefloodtimer 5 [list incr googleflood -1]if {[llength [split $arg]]==0} {putserv "PRIVMSG $channel :Baka, baka, baka !!!"} else {set query [string map {" " + \" %22 , %2C : %3A ; %3B \t %09 ! %21 # %23 \$ %24 % %25 &amp; %26 ' %27 ( %28 ) %29 = %3D § %C2%A7} $arg]switch $type {image{set query "http://$::googleip/images?btnI=&amp;q=${query}&amp;imgsafe=off"}file{set query "http://$::fmip/find.src?file=$query"}default {set query "http://$::googleip/search?btnI=&amp;q=$query"}}# Note: Useragent must start with Mozilla/ for googleif { [catch {egghttp:geturl $query [split "pub:google:cb $nick $chan $type"] -useragent "Mozilla/4.0 (TCL 8.4.7; egghttp $::egghttp(version); de-DE; OpenBSD 3.4)"} err] } {puthelp "NOTICE $nick :$err"}}}proc pub:google:cb {nick chan type token} {set headers [egghttp:headers $token]switch $type {image{if { [set found [regexp "imgurl\075(.*)\046imgrefurl" $headers {} newurl]] } {set newurl "http://$newurl"}}file{set found [regexp {(?n)&lt;a href=\"(.*)\"&gt;} [egghttp:data $token] {} newurl]}default{set found [regexp "Location:(.*)\n" $headers {} newurl]}}if {$found} {puthelp "PRIVMSG $chan :[string trim [string map {%25 %} $newurl]]"} elseif { [string match -nocase "*HTTP/1.? 200 OK*" $headers] || $type == "file" &amp;&amp; [string match -nocase "*not found" [egghttp:data $token]] } {puthelp "NOTICE $nick :No match found"} else {puthelp "NOTICE $nick :Unspecified error while phrasing webserver output."}}putlog "Google 1.2.2 - LOADED!"# close bracet from egghttp check}</code></pre></div>This should do for filemirror, but still everything in "single output". I am not absolutly sure about the url part string length, currently filename must shorter than 40 chars (included %xx codes) and hostname shorter than 50 chars. extension must be 1-5 chars. why? Because regexp tends to catch the widest string avaible, which could more be than 1 line in case of multimatchs (at least it did once for me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">).<br><br>for multiline you would have to rewrite a lot. Feel free to change it, I won't that soon <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br>For xgoogle goes the same, I don't need xgoogle, but I am sure, it could be easily integreated ^-^.<br><br>PS: I am running that script with a "sligthly" changed/enhanced egghttp.tcl, but it <em class="text-italics">should</em> not matter, but there is no guarantee for that <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Mar 17, 2005 8:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Thunderdome]]></name></author>
		<updated>2005-03-17T18:59:00-04:00</updated>

		<published>2005-03-17T18:59:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=47804#p47804</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=47804#p47804"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=47804#p47804"><![CDATA[
how can that googgle script (I also use it) work with filemirror?<br>That is the only part of the script that does not work.... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_neutral.gif" width="15" height="15" alt=":|" title="Neutral"><br>and how can one show 3 or X google results instead of one?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6079">Thunderdome</a> — Thu Mar 17, 2005 6:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2005-02-26T04:32:11-04:00</updated>

		<published>2005-02-26T04:32:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46937#p46937</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46937#p46937"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46937#p46937"><![CDATA[
<blockquote class="uncited"><div>The only google script i found that actually worked uses<div class="codebox"><p>Code: </p><pre><code>package require http</code></pre></div>I can send it you if you wish tho.</div></blockquote><br>it is not the working but the crashing using http lib crashes the bot .. ive seen it manytimes .. main reason why i never use that package anywhere ..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sat Feb 26, 2005 4:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-02-24T23:41:59-04:00</updated>

		<published>2005-02-24T23:41:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46906#p46906</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46906#p46906"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46906#p46906"><![CDATA[
no need to copy google-0.2.1.tcl, I already said it is a rewrite from this script as its original (even you maybe nolonger would recognize it, because I nearly rewrote everything).<br><div class="codebox"><p>Code: </p><pre><code># De Kus' google port from http to egghttp## 1.1.1 25.02.2005 fixed remote code execution from $nick# 1.1.0 25.02.2005 !image rewrote done# 1.0.1 24.02.2005 changed query string creation# 1.0.0 24.02.2005 rewrote done##following orignal header:## google.tcl v0.2.1## !google keywords - displays the first related website found from google in the channel# !image keywords  - displays the first related image found on google in the channel# !file keywords   - displays the first mirror download link found on filemirrors in the channel## by aNa|0Gue - analogue@glop.org - http://www.glop.org/## 04/17/2002 v0.2.1 useragent fix by FANif { ![info exists egghttp(version)] } {putlog "Could not verify egghttp.tcl beeing loaded!"} else {# close bracet extra documentatedbind pub - !google pub:google:cmdbind pub - !image pub:image:cmd#bind pub - !file pub:file:cmd# with this we avoid using the syncronous gethostbyname with CONNECT in egghttpdnslookup www.google.de getgoogledns:cbproc getgoogledns:cb {ip host status} {set ::googleip $ip}proc pub:google:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan google $argreturn 1}proc pub:image:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan image $argreturn 1}#proc pub:file:cmd {nick uhost hand chan arg} {#pub:google $nick $uhost $hand $chan file $arg#return 1#}proc pub:google {nick uhost handle chan type arg} {if {[llength $arg]==0} {putserv "PRIVMSG $channel :Baka, baka, baka !!!"} else {set query "?btnI=&amp;q=[string map {" " + \" %22 , %2C : %3A ; %3B \t %09 ! %21 # %23 \$ %24 % %25 &amp; %26 ' %27 ( %28 ) %29 = %3D § %C2%A7} $arg]"switch $type {image{set query "http://$::googleip/images${query}&amp;imgsafe=off"}file{return 0}default {set query "http://$::googleip/search$query"}}# Note: Useragent must start with Mozilla/ for googleif { [catch {egghttp:geturl $query [split "pub:google:cb $nick $chan $type"] -useragent "Mozilla/4.0 (TCL 8.4.7; egghttp 1.1.0; CYGWIN_NT-5.1)"} err] } {puthelp "NOTICE $nick :$err"}}}proc pub:google:cb {nick chan type token} {set headers [egghttp:headers $token]switch $type {image{if { [set found [regexp "imgurl\075(.*)\046imgrefurl" $headers {} newurl]] } {set newurl "http://$newurl"}}file{return 0}default {set found [regexp "Location:(.*)\n" $headers {} newurl]}}if {$found} {puthelp "PRIVMSG $chan :[string trim $newurl]"} elseif { [string match -nocase "*HTTP/1.? 200 OK*" $headers] } {puthelp "NOTICE $nick :No match found"} else {puthelp "NOTICE $nick :Unknown error while phrasing google output"}}#proc pub:file { nick uhost handle channel arg } {# global agent#if {[llength $arg]==0} {#putserv "PRIVMSG $channel :hey ! tappes un nom de fichier boulet !"#} else {#set query "http://www.filemirrors.com/find.src?file="#set query "$query[lindex $arg 0]"#    set token [http::config -useragent $agent]#if {[catch {set token [http::geturl $query]} sockerr]} {#puthelp "NOTICE $nick :$sockerr"#puthelp "NOTICE $nick :Try again later, look out the window till then!"#return 0#}#set html  [http::data $token]#upvar #0 $token state#set max 0#set result "[lindex $html 1]"#set result [string range $result [expr [string first = $result]+2] [expr [string first &gt; $result]-2]]#putserv "PRIVMSG $channel :$result"#return 1#}#}putlog "Google 1.0.0 - LOADED!"# close bracet from egghttp check}</code></pre></div>Note: I replaced the stupid foreach with a string map expression, which replaces most important special charters. you should be able to search like in google itself, something like<div class="codebox"><p>Code: </p><pre><code>eggdrop "news &amp; more" -porn</code></pre></div>will be absolutly fine.<br><br>Things you might want to change:<br>Line 30: dnslookup ... getgoogledns:cb<br>Line 61: -useragent "..."<br><br>yes, google.de has a sligthly diffrent search result than google.com! maybe you use your local google.whatever to optimize your result <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=2382">De Kus</a> — Thu Feb 24, 2005 11:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Longbow]]></name></author>
		<updated>2005-02-24T17:44:45-04:00</updated>

		<published>2005-02-24T17:44:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46899#p46899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46899#p46899"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46899#p46899"><![CDATA[
This doesn't help the original poster but... <blockquote class="uncited"><div>Note: !image doesnt work correctly atm., and I haven't rewritten the !file search, since its not google, but filemirror.com <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.</div></blockquote><div class="codebox"><p>Code: </p><pre><code>bind pub - !image pub:imageproc pub:image { nick uhost handle channel arg } { global agentif {[llength $arg]==0} {putserv "NOTICE $nick :You need to enter a image."} else {set query "http://images.google.de/images?btnI=&amp;q="for { set index 0 } { $index&lt;[llength $arg] } { incr index } {set query "$query[lindex $arg $index]"if {$index&lt;[llength $arg]-1} then {set query "$query+"}}append query &amp;imgsafe=off                set token [http::config -useragent $agent]set token [http::geturl $query]puts stderr ""upvar #0 $token stateset max 0foreach {name value} $state(meta) {if {[regexp -nocase ^location$ $name]} {set starturl "http://"set newurl [string trim $value]set newurl [string range $newurl [expr [string first = $newurl]+1] [expr [string first &amp; $newurl]-1]]append starturl $newurlputserv "PRIVMSG $channel :$arg: $starturl"}}}}</code></pre></div>^^ Thats what i've got for google image.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5887">Longbow</a> — Thu Feb 24, 2005 5:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-02-23T23:55:09-04:00</updated>

		<published>2005-02-23T23:55:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46883#p46883</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46883#p46883"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46883#p46883"><![CDATA[
and thats exakt the kind useless for me, because the package http (avaible under lib/tcl8.4/http2.5) is useless for me, it crachs (more or less randomly. one day it will crash on query xy, next week on yz @_o), dont ask me why... I believe its a problem with cygwin and tcl (but seems noone on windrop.sourceforge.com knows any more, either). I guess I'll have to rewrite it to egghttp myself, I hoped I could spare the work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br><div class="codebox"><p>Code: </p><pre><code># De Kus' google port from http to egghttp## 1.0.0 24.02.2005 rewrote done##following orignal header:## google.tcl v0.2.1## !google keywords - displays the first related website found from google in the channel# !image keywords  - displays the first related image found on google in the channel# !file keywords   - displays the first mirror download link found on filemirrors in the channel## by aNa|0Gue - analogue@glop.org - http://www.glop.org/## 04/17/2002 v0.2.1 useragent fix by FANif { ![info exists egghttp(version)] } {putlog "Could not verify egghttp.tcl beeing loaded!"} else {# close bracet extra documentatedbind pub - !google pub:google:cmdbind pub - !image pub:image:cmd#bind pub - !file pub:file:cmd# with this we avoid using the syncronous gethostbyname with CONNECT in egghttpdnslookup www.google.de getgoogledns:cbproc getgoogledns:cb {ip host status} {set ::googleip $ip}proc pub:google:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan google $argreturn 1}proc pub:image:cmd {nick uhost hand chan arg} {pub:google $nick $uhost $hand $chan image $argreturn 1}#proc pub:file:cmd {nick uhost hand chan arg} {#pub:google $nick $uhost $hand $chan file $arg#return 1#}proc pub:google {nick uhost handle chan type arg} {if {[llength $arg]==0} {putserv "PRIVMSG $channel :Baka, baka, baka !!!"} else {set query "http://$::googleip/search?btnI=&amp;q="for { set index 0 } { $index&lt;[llength $arg] } { incr index } {set query "$query[lindex $arg $index]"if {$index&lt;[llength $arg]-1} then {set query "$query+"}}switch $type {image{append query &amp;imgsafe=off}file{return 0}default {}}# Note: Useragent must start with Mozilla/ for googleif { [catch {egghttp:geturl $query "pub:google:cb $nick $chan" -useragent "Mozilla/4.0 (TCL 8.4.7; egghttp 1.1.0; CYGWIN_NT-5.1)"} err] } {puthelp "NOTICE $nick :$err"}}}proc pub:google:cb {nick chan token} {set headers [egghttp:headers $token]if {[regexp "Location:(.*)\n" $headers {} newurl]} {puthelp "PRIVMSG $chan :[string trim $newurl]"} elseif { [string match -nocase "*HTTP/1.? 200 OK*" $headers] } {puthelp "NOTICE $nick :No match found"} else {puthelp "NOTICE $nick :Unknown error while phrasing google output"}}#proc pub:file { nick uhost handle channel arg } {# global agent#if {[llength $arg]==0} {#putserv "PRIVMSG $channel :hey ! tappes un nom de fichier boulet !"#} else {#set query "http://www.filemirrors.com/find.src?file="#set query "$query[lindex $arg 0]"#    set token [http::config -useragent $agent]#if {[catch {set token [http::geturl $query]} sockerr]} {#puthelp "NOTICE $nick :$sockerr"#puthelp "NOTICE $nick :Try again later, look out the window till then!"#return 0#}#set html  [http::data $token]#upvar #0 $token state#set max 0#set result "[lindex $html 1]"#set result [string range $result [expr [string first = $result]+2] [expr [string first &gt; $result]-2]]#putserv "PRIVMSG $channel :$result"#return 1#}#}putlog "Google 1.0.0 - LOADED!"# close bracet from egghttp check}</code></pre></div>Note: !image doesnt work correctly atm., and I haven't rewritten the !file search, since its not google, but filemirror.com <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Feb 23, 2005 11:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-02-23T14:16:54-04:00</updated>

		<published>2005-02-23T14:16:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46874#p46874</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46874#p46874"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46874#p46874"><![CDATA[
The only google script i found that actually worked uses<div class="codebox"><p>Code: </p><pre><code>package require http</code></pre></div>I can send it you if you wish tho.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Wed Feb 23, 2005 2:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-02-23T12:33:52-04:00</updated>

		<published>2005-02-23T12:33:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=46871#p46871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=46871#p46871"/>
		<title type="html"><![CDATA[google script without package http]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=46871#p46871"><![CDATA[
I looked around a bit, but all script I found where using the lib http which functions tend to crash my windrop. I have noticed using egghttp is save for me, so I wonder if there is any based on this one? either way I'd have to do it myself again @_o.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Feb 23, 2005 12:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
