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

	<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-07-29T13:52:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[urban]]></name></author>
		<updated>2006-07-29T13:52:14-04:00</updated>

		<published>2006-07-29T13:52:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64989#p64989</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64989#p64989"/>
		<title type="html"><![CDATA[Yet another &quot;fetch info from the web&quot; Request.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64989#p64989"><![CDATA[
Anybody help ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8027">urban</a> — Sat Jul 29, 2006 1:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[krimson]]></name></author>
		<updated>2006-07-29T08:39:10-04:00</updated>

		<published>2006-07-29T08:39:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64981#p64981</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64981#p64981"/>
		<title type="html"><![CDATA[Yet another &quot;fetch info from the web&quot; Request.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64981#p64981"><![CDATA[
you should put your code between [code] [/code] tags when posting any type of code or log. this will remove any smilies that may show up and make the code hard to read<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7663">krimson</a> — Sat Jul 29, 2006 8:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[urban]]></name></author>
		<updated>2006-07-29T08:40:57-04:00</updated>

		<published>2006-07-29T08:29:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64980#p64980</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64980#p64980"/>
		<title type="html"><![CDATA[i am using this code but i still get the no such var]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64980#p64980"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc test { nick user hand chan text } {package require base64set exp {http://([^\ ]+)(\ +)l:([^\ ]+)(\ +)p:(\w+)} if {[regexp -nocase $exp $text full url x login y pass]} {        } else {   set exp {http://(.*):(.*)@(.*)}   if {[regexp -nocase $exp $text full login pass url path]} {    set url [lindex [split $url] 0]       } else {        return 0   } set collect ""    putlog "workjing $url $login $pass"catch { set collect [::http::geturl $url -timeout 3000 -headers [list Authorization "Basic [::base64::encode $login:$pass]"] } error if {[string match -nocase "*couldn't open socket*" $error]} {                puthelp "PRIVMSG $chan :Error: couldn't connect..  "                ::http::cleanup $collect                return 0     }     putlog "$collect ssss"     #if { [::http::status $collect] == "timeout" } {               # puthelp "PRIVMSG $chan :Error: Connection timed out.  "               # ::http::cleanup $collect               # return 0     #} if {[string match -nocase "*connect failed connection refused*" $error]} {puthelp "PRIVMSG $chan :Error: Connection refused..  "                ::http::cleanup $collect                return 0     }}if { $collect == "" } { putlog "not working";return 0 }putlog "worked"}using windrop</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8027">urban</a> — Sat Jul 29, 2006 8:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-07-28T21:04:27-04:00</updated>

		<published>2006-07-28T21:04:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64977#p64977</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64977#p64977"/>
		<title type="html"><![CDATA[Yet another &quot;fetch info from the web&quot; Request.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64977#p64977"><![CDATA[
That would indicate that the geturl failed.. You can put <br><br>set page ""  <br><br>Somewhere above the "catch {set page" part and then test to see if page is empty..<br><br>Don't know bout windrop, the script works for me in linux &amp; bsd. I'm guessing that windrop's http is broke and does not set the var on failure.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Jul 28, 2006 9:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[urban]]></name></author>
		<updated>2006-07-28T19:26:02-04:00</updated>

		<published>2006-07-28T19:26:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64973#p64973</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64973#p64973"/>
		<title type="html"><![CDATA[Yet another &quot;fetch info from the web&quot; Request.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64973#p64973"><![CDATA[
<blockquote class="uncited"><div>bind pub - !geturl geturlproc<br><br>proc geturlproc {nick uhost hand chan text} {<br>     set text [string trim $text]<br>     set text [split $text]<br>     set url "<a href="http://craxxe.sytes.net/irc.asp?get=" class="postlink">http://craxxe.sytes.net/irc.asp?get=</a>"<br>     catch {set page [::http::geturl $url[join $text] -timeout 90000]} error<br>     if {[string match -nocase "*couldn't open socket*" $error]} {<br>                puthelp "PRIVMSG $nick :Error: couldn't connect.."<br>                ::http::cleanup $page<br>                return<br>     }<br>     if { [::http::status $page] == "timeout" } {<br>                puthelp "PRIVMSG $nick :Error: Connection timed out."<br>                ::http::cleanup $page<br>                return<br>     }<br><br>     set html [::http::data $page]<br>     ::http::cleanup $page<br><br>      foreach line {[split $html \n]} {<br>                if {[regexp -nocase {&lt;distinguishing html code data&gt;(.*?)&lt;more html code&gt;} $html match gottextmatchvar]} {<br>                    puthelp "PRIVMSG $nick :Here's the data: [join $gottextmatchvar]"<br>                }<br>      }<br>}<br></div></blockquote>i try this and i get page var does not exsist i am using windrop !!<br><br>Any help ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8027">urban</a> — Fri Jul 28, 2006 7:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-06-29T05:08:38-04:00</updated>

		<published>2006-06-29T05:08:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64426#p64426</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64426#p64426"/>
		<title type="html"><![CDATA[Yet another &quot;fetch info from the web&quot; Request.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64426#p64426"><![CDATA[
My isp is having fits as usual, so I can't connect to the site to look at the html to make a template. If you can post the raw html code to show what data you're looking to grab, I'm sure we can make a regex to get the data in to a usable format.<br><br>As far as how to make a basic tcl script to grab the webpage:<br><div class="codebox"><p>Code: </p><pre><code>#sample html grabber scriptpackage require http 2.3bind pub - !geturl geturlprocproc geturlproc {nick uhost hand chan text} {     set text [string trim $text]     set text [split $text]     set url "http://craxxe.sytes.net/irc.asp?get="     catch {set page [::http::geturl $url[join $text] -timeout 90000]} error     if {[string match -nocase "*couldn't open socket*" $error]} {                puthelp "PRIVMSG $nick :Error: couldn't connect.."                ::http::cleanup $page                return     }     if { [::http::status $page] == "timeout" } {                puthelp "PRIVMSG $nick :Error: Connection timed out."                ::http::cleanup $page                return     }     set html [::http::data $page]     ::http::cleanup $page      foreach line {[split $html \n]} {                if {[regexp -nocase {&lt;distinguishing html code data&gt;(.*?)&lt;more html code&gt;} $html match gottextmatchvar]} {                    puthelp "PRIVMSG $nick :Here's the data: [join $gottextmatchvar]"                }      }}</code></pre></div>Read the regexp page and re_syntax manual pages about () used for reporting matches, essentially everything within (.*?) is what is captured into a variable. You can capture more than 1 thing into multiple vars in the same regexp. <br><br>The script I just wrote for "This Day In History" might be a good example:<br><a href="http://members.dandy.net/~fbn/tdih.tcl.txt" class="postlink">http://members.dandy.net/~fbn/tdih.tcl.txt</a><br><br>Hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Jun 29, 2006 5:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CraXyOW3]]></name></author>
		<updated>2006-06-18T01:33:06-04:00</updated>

		<published>2006-06-18T01:33:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64131#p64131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64131#p64131"/>
		<title type="html"><![CDATA[Yet another &quot;fetch info from the web&quot; Request.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64131#p64131"><![CDATA[
Well, where should i start then.<br><br>Ok, i have been a user of mIRC for a very long time and has always been a wannabe *nix user and always out to broaden my knowledge of things.<br>Now i have found eggdrop and tried alot of scripts and worked my way around to customise it.<br>The problem i got now is that i have forgotten how the heck i made my mIRC script work and dont have a clue on how to proceed to convert it to TCL even if they are both quite similar to eachoter.<br><br>What this script does then?<br>1. Channel user types " !akfind keyword" in channel.<br>2. Script recognizes it.<br>3. Script connects to server and gets information depending on keywords.<br>4. The page is loaded and gives results according to keywords.<br>5. Script saves a temp file with information.<br>6. Script notices user the results from the find.<br>7. Script deletes temp file.<br><br>What i cant seem to figure out is the delay on notice and posting multiple lines of information to user.<br><br>I would appreciate a complete conversion of this and i would appreciate it even more if i got <span style="text-decoration:underline">alot of hints and tips</span> instead, on how to proceed with this!<br><br>Btw, i have searched this place, the all knowing google and some other resources too but failed.<br><br>Here is the mIRC script:<div class="codebox"><p>Code: </p><pre><code>alias akfind {  var %sockname = $+(akfinder.,$ctime,.,$replace($1-,$chr(32),.))  if ($sock(%sockname)) { return }  sockopen %sockname localhost 80  sockmark %sockname http_connect $1 $2-}on *:text:.akfind *:#:{  akfind $nick $2-}on *:sockopen:akfinder.*:{  tokenize 32 $sock($sockname).mark  sockwrite -n $sockname GET /irc.asp?get= $+ $replace($3-,$chr(32),$+($chr(37),20)) HTTP/1.0  sockwrite -n $sockname Host: localhost  sockwrite -n $sockname Connection: Close  sockwrite -n $sockname $crlf}on *:sockread:akfinder.*:{  tokenize 32 $sock($sockname).mark  var %tmp  sockread %tmp  if ($1 == http_connect) {    if (!%tmp) { sockmark $sockname http_read $2- }  }  elseif ($1 == http_read) {    if (%tmp == ---- start of find ----) { sockmark $sockname http_read_send $2- }  }  elseif ($1 == http_read_send) {    if (%tmp == ---- eof of Find ----) { sockmark $sockname http_read $2- }    else { write $+(tmpdata,$2) $2 $iif($remove(%tmp,-),$ifmatch,-) }  }}on *:sockclose:akfinder.*:{  tokenize 32 $sock($sockname).mark  .play -n $2 $+(tmpdata,$2)  .remove $+(tmpdata,$2)}</code></pre></div>For those who want to try using the webpage it is located here:<br><a href="http://craxxe.sytes.net/irc.asp?get=keyword" class="postlink">http://craxxe.sytes.net/irc.asp?get=keyword</a><br>as this is an anime related thing you can try any title you wish. example "burn" "chobits" "bebop".<br><br>I have also worked with package http and egghttp but i quite dont get it yet, this is the closest to the finished thing ive found -&gt; <a href="http://www.tclscript.com/egghttp_tut.shtml" class="postlink">http://www.tclscript.com/egghttp_tut.shtml</a><br>But still, it only types out one line.<br><br>One last thing, the way the irc.asp files generates the file can be changed to anything else, as another older version of my mIRC script exchanged "-" signs to simple " " spaces, just the anser to all the "---" signs <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br>(the site isnt up for the moment.)<br><br><strong class="text-strong">EDIT</strong><br>Hrm, i have been looking around some more and now i know for a fact that this script is doable, altho i am a novice at this still, i get confused while reading the code.<br>So far the script i have found sofar has helped me some (!bash script on this site) but i would still want some hints and tips on how to make this work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7889">CraXyOW3</a> — Sun Jun 18, 2006 1:33 am</p><hr />
]]></content>
	</entry>
	</feed>
