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

	<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-01-27T16:32:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-01-27T16:32:21-04:00</updated>

		<published>2006-01-27T16:32:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59796#p59796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59796#p59796"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59796#p59796"><![CDATA[
all characters under REGULAR EXPRESSION SYNTAX on <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/re_syntax.htm" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/re_syntax.htm</a> must be escaped. Reading the manual usually enligthens <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> — Fri Jan 27, 2006 4:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rix]]></name></author>
		<updated>2006-01-23T17:01:24-04:00</updated>

		<published>2006-01-23T17:01:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59643#p59643</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59643#p59643"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59643#p59643"><![CDATA[
Im still messing around with these files. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>First script still gives only one result. I only changed the regexp command. Somehow the 2in1 regexp doesn't work anymore. Just no result at all. If I add puthelp command in loop, it doesn't show any result either.<br><div class="codebox"><p>Code: </p><pre><code>set url "http://www.starpump.ee/linkme.php"set trigger "!latestposts"set channel "#star"if {![info exists egghttp(version)]} {  putlog "egghttp.tcl was NOT successfully loaded."  putlog "latestposts.tcl has not been loaded as a result."} else {  proc setup {sock} {    global url channel    set headers [egghttp:headers $sock]    set body [egghttp:data $sock]   foreach line [split $body \n]  {    regexp {&lt;a href=".*?"target="_blank"&gt;(.*?)&lt;/a&gt;} $line - title    regexp {&lt;a href="(.*?)"target="_blank"&gt;} $line - link   }    puthelp "PRIVMSG $channel :$title - $link "  }  bind pub -|* $trigger action  proc action {nick host hand chan text} {    global url    set sock [egghttp:geturl $url setup]    return 1  }  putlog "latestposts.tcl has been successfully loaded."} </code></pre></div>If puthelp command is in the loop also, it doesn't reply anything.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6753">rix</a> — Mon Jan 23, 2006 5:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ehlanna]]></name></author>
		<updated>2006-01-16T22:02:07-04:00</updated>

		<published>2006-01-16T22:02:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59466#p59466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59466#p59466"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59466#p59466"><![CDATA[
My best guess would be that it was being treated as a special character, and you would thus need to quote it ... \?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6506">Ehlanna</a> — Mon Jan 16, 2006 10:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rix]]></name></author>
		<updated>2006-01-16T14:28:32-04:00</updated>

		<published>2006-01-16T14:28:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59458#p59458</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59458#p59458"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59458#p59458"><![CDATA[
Big thanks, guys!<br><br>I hope I'm not too arrogant when asking another thing.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> <br><br>I have another script based on same structure, but it doesn't recognize the "?" in the url. It's important, as channel= will give appropriate feed. It's weird, cause other scripts are doing well. :S<div class="codebox"><p>Code: </p><pre><code>set feed "http://www.w3.ee/export/tv.php?channel=2"set trigger "!kanal2"set channel "#star"if {![info exists egghttp(version)]} {  putlog "egghttp.tcl was NOT successfully loaded."  putlog "tv2.tcl has not been loaded as a result."} else {  proc callback{sock} {    global feed channel    set headers [egghttp:headers $sock]    set body [egghttp:data $sock]   foreach line [split $body \n] {    regexp {(.*?)&lt;b&gt;} $body - time    regexp {&lt;b&gt;(.*?)&lt;/b&gt;} $body - title    regexp {&lt;/b&gt;.*?&lt;br&gt;(.*?)&lt;br&gt;} $body - desc   }   puthelp "PRIVMSG $channel :(Algus: $time) \002$title\002"   puthelp "PRIVMSG $channel :$desc"  }  bind pub -|* $trigger top:trigger  proc top:trigger {nick host hand chan text} {    global feed    set sock [egghttp:geturl $rssfeed callback]    return 1  }  putlog "tv2.tcl has been successfully loaded."}</code></pre></div>It takes information from w3.ee/export/tv.php though it should take it from w3.ee/export/tv.php?channel=2.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6753">rix</a> — Mon Jan 16, 2006 2:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ehlanna]]></name></author>
		<updated>2006-01-12T20:51:05-04:00</updated>

		<published>2006-01-12T20:51:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59361#p59361</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59361#p59361"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59361#p59361"><![CDATA[
<blockquote class="uncited"><div>probably too faithfully pasting</div></blockquote>Wood/trre syndrome, far too easy to suffer from!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6506">Ehlanna</a> — Thu Jan 12, 2006 8:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-01-12T08:04:06-04:00</updated>

		<published>2006-01-12T08:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59341#p59341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59341#p59341"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59341#p59341"><![CDATA[
<blockquote class="uncited"><div>I would say that you want to swap $body to $line in the regexp command as $line is the variable that changes with each iteration of the loop.</div></blockquote>lol, beat why I didnt notice that myself, was probably too faithfully pasting together <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> — Thu Jan 12, 2006 8:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ehlanna]]></name></author>
		<updated>2006-01-11T18:48:24-04:00</updated>

		<published>2006-01-11T18:48:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59328#p59328</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59328#p59328"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59328#p59328"><![CDATA[
At a rough guess, and speaking as a self-taught , beginner tcl coder, I would say that you want to swap $body to $line in the regexp command as $line is the variable that changes with each iteration of the loop.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6506">Ehlanna</a> — Wed Jan 11, 2006 6:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rix]]></name></author>
		<updated>2006-01-09T14:04:24-04:00</updated>

		<published>2006-01-09T14:04:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59293#p59293</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59293#p59293"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59293#p59293"><![CDATA[
The speed is not important at the moment. By the way, I merged 2regexp into 1 and included puthelp right after regexp in the loop, but it keeps repeating one result. :s<br><br>[20:01:10] &lt;rix&gt; !latestposts<br>[20:01:13] &lt;StarBot&gt; Q: DVD subtiitrid - <a href="http://www.starpump.ee/viewthread.php?tid=29612" class="postlink">http://www.starpump.ee/viewthread.php?tid=29612</a> <br>[20:01:15] &lt;StarBot&gt; Q: DVD subtiitrid - <a href="http://www.starpump.ee/viewthread.php?tid=29612" class="postlink">http://www.starpump.ee/viewthread.php?tid=29612</a> <br>[20:01:17] &lt;StarBot&gt; Q: DVD subtiitrid - <a href="http://www.starpump.ee/viewthread.php?tid=29612" class="postlink">http://www.starpump.ee/viewthread.php?tid=29612</a><br>...and so on<br><br>How do I avoid that?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6753">rix</a> — Mon Jan 09, 2006 2:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-01-09T11:54:45-04:00</updated>

		<published>2006-01-09T11:54:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59287#p59287</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59287#p59287"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59287#p59287"><![CDATA[
include 'puthelp "PRIVMSG $channel :$title - $link "' in the foreach loop.<br><br>btw you can merge the 2 regexp into 1:<br>    regexp {&lt;a href="([^"]+)" target="_blank"&gt;([^&lt;]+)&lt;/a&gt;} $body {} link title<br><br>Note: I assumed the missing space in the expression was an error. And I usually prefer something like [^&lt;] to . because regexp tries to find the widest match, but you dont want the match to pass the closing &lt;/ tags or " braces, so matching every character but that ones are usually more predictable <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. I hope it doesnt make a too big slowdown, haven't comapred it yet to be honest <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> — Mon Jan 09, 2006 11:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rix]]></name></author>
		<updated>2006-01-08T17:28:10-04:00</updated>

		<published>2006-01-08T17:28:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59267#p59267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59267#p59267"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59267#p59267"><![CDATA[
Okay, I did a little research again and got it working. Just one thing more. It shows only one (first) result. How do i loop this thingie?<br><div class="codebox"><p>Code: </p><pre><code>set url "http://www.starpump.ee/linkme.php"set trigger "!latestposts"set channel "#star"if {![info exists egghttp(version)]} {  putlog "egghttp.tcl was NOT successfully loaded."  putlog "latestposts.tcl has not been loaded as a result."} else {  proc setup {sock} {    global url channel    set headers [egghttp:headers $sock]    set body [egghttp:data $sock]   foreach line [split $body \n] {    regexp {&lt;a href=".*?"target="_blank"&gt;(.*?)&lt;/a&gt;} $body - title    regexp {&lt;a href="(.*?)"target="_blank"&gt;} $body - link   }    puthelp "PRIVMSG $channel :$title - $link "  }  bind pub -|* $trigger action  proc action {nick host hand chan text} {    global rssfeed    set sock [egghttp:geturl $url setup]    return 1  }   putlog "latestposts.tcl has been successfully loaded."}</code></pre></div>Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6753">rix</a> — Sun Jan 08, 2006 5:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-01-08T10:12:32-04:00</updated>

		<published>2006-01-08T10:12:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59250#p59250</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59250#p59250"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59250#p59250"><![CDATA[
Read TCLCommands.doc, section "BIND" especially for DCC and PUB. Its not up to, it must match exactly (well, actually there are workarounds, but they should be only used if dynamic is requried).<br>Tip: you will probably NOT want to output unfiltered regexp -all output.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun Jan 08, 2006 10:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[avilon]]></name></author>
		<updated>2006-01-07T11:50:48-04:00</updated>

		<published>2006-01-07T11:50:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59205#p59205</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59205#p59205"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59205#p59205"><![CDATA[
Use <a href="http://tcl.tk/man/tcl8.4/TclCmd/http.htm" class="postlink">http package</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5191">avilon</a> — Sat Jan 07, 2006 11:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rix]]></name></author>
		<updated>2006-01-07T11:10:44-04:00</updated>

		<published>2006-01-07T11:10:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=59204#p59204</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=59204#p59204"/>
		<title type="html"><![CDATA[handling regular expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=59204#p59204"><![CDATA[
Hey!<br><br>Im new to this, so I try to make myself clear as possible. I need to take url and text from <a href="http://www.starpump.ee/linkme.php" class="postlink">this link</a> and show them in the channel.<br><br>I tryed something like this:<div class="codebox"><p>Code: </p><pre><code>set url "http://www.starpump.ee/linkme.php"if {![info exists egghttp(version)]} {  putlog "egghttp.tcl was NOT successfully loaded."  putlog "lasttopics.tcl has not been loaded as a result."} else {  proc your_callbackproc {sock} {    global url    set headers [egghttp:headers $sock]    set body [egghttp:data $sock]    foreach line [split $body \n] {      regexp -all {&lt;a href=".*?"&gt;(.*?)&lt;/a&gt;} $line text    }    putserv "PRIVMSG $chan : $text  }  bind pub - !lasttopics our:dcctrigger  proc our:dcctrigger {hand idx text} {    global url     set sock [egghttp:geturl $url your_callbackproc]    set chan #star    return 1  }    putlog "egghttp_example.tcl has been successfully loaded."}</code></pre></div>It gives error: Tcl error [our:dcctrigger]: called "our:dcctrigger" with too many arguments. I thought I can even use 5 arguments in the brackets.<br><br>Anyway, there's enough tutorials saying what to do. Yes, that's good. The one major problem is that i can't find any instructions how to turn it to actually working script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6753">rix</a> — Sat Jan 07, 2006 11:10 am</p><hr />
]]></content>
	</entry>
	</feed>
