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

	<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>2004-02-02T13:09:32-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-02-02T13:09:32-04:00</updated>

		<published>2004-02-02T13:09:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=33179#p33179</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=33179#p33179"/>
		<title type="html"><![CDATA[okay.. figured out how regexp syntax works]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=33179#p33179"><![CDATA[
okay.. figured out how regexp syntax works<br>but now i still have the problem of the foreach loop stopping after the first match... using this code:<br>  <div class="codebox"><p>Code: </p><pre><code>        set data2 [http::data $data]         http::cleanup $data        foreach line [split $data2 \n] {        if {[regexp {&lt;NOBR&gt;(.*?)&lt;/NOBR&gt;} $line data2 a ]} {            puthelp "NOTICE $chan :$a"           }</code></pre></div>why is the loop stopping?<p>Statistics: Posted by Guest — Mon Feb 02, 2004 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[t3ch^]]></name></author>
		<updated>2004-01-26T15:50:45-04:00</updated>

		<published>2004-01-26T15:50:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32904#p32904</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32904#p32904"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32904#p32904"><![CDATA[
&lt;---- was only there to notice you about a wrong typing in the code.<br><br>it was at first $data when it should be $line<br><br>//<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4315">t3ch^</a> — Mon Jan 26, 2004 3:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2004-01-25T10:56:29-04:00</updated>

		<published>2004-01-25T10:56:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32859#p32859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32859#p32859"/>
		<title type="html"><![CDATA[defining tags from the page in the expression]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32859#p32859"><![CDATA[
Tcl provides two pattern matching mechanisms: glob-style patterns and regular expressions. Of the two, regular expressions are more difficult to understand and apply correctly, but they're much more powerful.<br><br>I have noticed that regexp is more powerful and more difficult.. <br>i have been sitting here trying to solve it but i have to request your assistance.. <br>I looked at the <a href="http://tcl.activestate.com/man/tcl8.4/TclCmd/http.htm" class="postlink">http://tcl.activestate.com/man/tcl8.4/TclCmd/http.htm</a> page.. which helped me understand a bit.. <br>but the parsing on my page stops at the tags &lt;NOBR&gt; spitting out: <br>[2:55pm] &lt;PeteyB&gt; &lt;NOBR&gt;[0123] Site remodified&lt;/NOBR&gt;<br>as u can see it spits out the html tag and the string i am looking for.. and stops parsing on further... <br>i tried replacing the <div class="codebox"><p>Code: </p><pre><code>if {[regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line &lt;---- data2 a b]}</code></pre></div>with<div class="codebox"><p>Code: </p><pre><code>if {[regexp -nocase {&lt;a href="*&lt;NOBR&gt;*"&gt;"*&lt;/NOBR&gt;*"&lt;/a&gt;} $line &lt;---- data2 a b]}</code></pre></div>and other variations.. <br><br>i know u are probably laughing... (me too) but thx for the help<p>Statistics: Posted by Guest — Sun Jan 25, 2004 10:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-01-02T12:20:22-04:00</updated>

		<published>2004-01-02T12:20:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32077#p32077</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32077#p32077"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32077#p32077"><![CDATA[
well ill test it and once i find out .. ill let u know but i think it makes more will make more errors then do good hehe<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Jan 02, 2004 12:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-01-02T07:25:52-04:00</updated>

		<published>2004-01-02T07:25:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32064#p32064</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32064#p32064"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32064#p32064"><![CDATA[
I have no idea.. it wasn't me that put the &lt;---- in there <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>test it and see what it does... and then tell meh  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Fri Jan 02, 2004 7:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-12-31T12:20:01-04:00</updated>

		<published>2003-12-31T12:20:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32036#p32036</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32036#p32036"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32036#p32036"><![CDATA[
ah tnx nice ic what u mean now <br><blockquote class="uncited"><div>(.*?)"&gt;(.*?)</div></blockquote>sets the url to  a and name of url to b <br><blockquote class="uncited"><div>if {[regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line<span style="color:red"> &lt;---- </span>data2 a b]} {</div></blockquote>&lt;---- what does this do ? just some info ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Dec 31, 2003 12:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-12-31T11:50:01-04:00</updated>

		<published>2003-12-31T11:50:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32035#p32035</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32035#p32035"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32035#p32035"><![CDATA[
sorry my bad<br>you are correct =)<div class="codebox"><p>Code: </p><pre><code>if {[regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line &lt;---- data2 a b]} {</code></pre></div>this would be almost like<div class="codebox"><p>Code: </p><pre><code>string match "&lt;a href=\"*\"&gt;*&lt;/a&gt;" $line</code></pre></div>ofc the difference is that where the string match only returns 1 or 0, the regexp puts the matches in different vars<br>so I'm not replacing chars, I'm just puliing out the needed info <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=852">Papillon</a> — Wed Dec 31, 2003 11:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-12-31T11:40:07-04:00</updated>

		<published>2003-12-31T11:40:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32034#p32034</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32034#p32034"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32034#p32034"><![CDATA[
correct me if i am wrong if i understand correctly then it would be <br><div class="codebox"><p>Code: </p><pre><code>regsub {(\\){2}} $txt {\\\\\\\\} ntxt</code></pre></div>=<br><div class="codebox"><p>Code: </p><pre><code>string map {\\\\ \\\\\\\\} $arg</code></pre></div><blockquote class="uncited"><div>the {2} means that it wants exactly 2 matches of \\ to switch with {\\\\\\\\} </div></blockquote>cause the other map is doing \ &gt; \\ but if u use \ it wouldn't work so i must use \\ and replace it with \\\\ so this means output \ =&gt; \\<br><br>if i understand right u are saing \\\\ =&gt; \\\\\\\\ out put \\ =&gt; \\\\<br><br>just verifying if i understand correctly<br><br>also <br><blockquote class="uncited"><div>if {[<span style="color:red">regexp</span> -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line &lt;---- data2 a b]} {</div></blockquote>so if i am supposed to use regsub why u use regexp ?? i mean what is it doing then ? i tought u where replacing chars<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Dec 31, 2003 11:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-12-31T11:23:26-04:00</updated>

		<published>2003-12-31T11:23:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32033#p32033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32033#p32033"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32033#p32033"><![CDATA[
if you want to compare string map and re_syntax you would have to use regsub<br>regexp is used to compare strings and add the matches to different vars<br>regsub is used to switch bits of strings, they both use re_syntax to achieve this<div class="codebox"><p>Code: </p><pre><code>string map -nocase {\\ \\\\} $argregsub {(\\){2}} $txt {\\\\\\\\} ntxt</code></pre></div>these two would do exactly the same<br>as you can see you need some \'s to escape the following \'s<br>the {2} means that it wants exactly 2 matches of \\ to switch with {\\\\\\\\}<br>you could write it like this:<div class="codebox"><p>Code: </p><pre><code>regsub {(\\\\)} $txt {\\\\\\\\} ntxt</code></pre></div>which is exactly the same as the one above <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=852">Papillon</a> — Wed Dec 31, 2003 11:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2003-12-31T09:49:31-04:00</updated>

		<published>2003-12-31T09:49:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32026#p32026</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32026#p32026"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32026#p32026"><![CDATA[
i know its fixed but i am trying to understand the code <br><blockquote class="uncited"><div>if {[regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line line a b]} { </div></blockquote><br>this part i don't understand <br><br>i know string map but never understood regexp realy<br><br>like : <div class="codebox"><p>Code: </p><pre><code>[string map -nocase {\\ \\\\} $arg] </code></pre></div>what would this look like ?? in regexp<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Wed Dec 31, 2003 9:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[t3ch^]]></name></author>
		<updated>2003-12-30T18:57:59-04:00</updated>

		<published>2003-12-30T18:57:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32003#p32003</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32003#p32003"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32003#p32003"><![CDATA[
man i love you!<br>thx alot<br><br>happy new year all<br><br>[edit]<div class="codebox"><p>Code: </p><pre><code># set this outside the proc, it's saferpackage require httpbind pub - !www www:wwwproc www:www {nick host handle chan text} {        #why setting these here?        set a ""        set b ""        #what you use this for?        set token [http::config -useragent "Mozilla 4.0"]        set url "http://lajt.mine.nu/index.php"        set data [http::geturl $url]        set data2 [http::data $data]        http::cleanup $data        foreach line [split $data2 \n] {          if {[regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line &lt;---- data2 a b]} {            puthelp "PRIVMSG $chan :$a"          }        } }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4315">t3ch^</a> — Tue Dec 30, 2003 6:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-12-30T19:02:00-04:00</updated>

		<published>2003-12-30T18:57:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32002#p32002</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32002#p32002"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32002#p32002"><![CDATA[
you need a loop to go through each line..<div class="codebox"><p>Code: </p><pre><code># set this outside the proc, it's saferpackage require http bind pub - !www www:www proc www:www {nick host handle chan text} {         #why setting these here?         set a ""         set b ""         #what you use this for?         set token [http::config -useragent "Mozilla 4.0"]         set url "http://lajt.mine.nu/index.php"         set data [http::geturl $url]         set data2 [http::data $data]         http::cleanup $data         foreach line [split $data2 \n] {           if {[regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $line line a b]} {             puthelp "PRIVMSG $chan :$a"           }         }  }</code></pre></div>umm... sorry I forgot to change the variable in the regexp, it's fixed now <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=852">Papillon</a> — Tue Dec 30, 2003 6:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[t3ch^]]></name></author>
		<updated>2003-12-30T18:35:51-04:00</updated>

		<published>2003-12-30T18:35:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32001#p32001</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32001#p32001"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32001#p32001"><![CDATA[
thx, now i do get some data from www but its not working as i want it to...<br><br>My code:<div class="codebox"><p>Code: </p><pre><code>bind pub - !www www:wwwproc www:www {nick host handle chan text} {        package require http        set a ""        set b ""        set token [http::config -useragent "Mozilla 4.0"]        set url "http://lajt.mine.nu/index.php"        set data [http::geturl $url]        set data2 [http::data $data]        http::cleanup $data        regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $data2 data2 a b        puthelp "PRIVMSG $chan :$a"        regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $data2 data2 a b        puthelp "PRIVMSG $chan :$a"        regexp -nocase {&lt;a href="(.*?)"&gt;(.*?)&lt;/a&gt;} $data2 data2 a b        puthelp "PRIVMSG $chan :$a"}</code></pre></div>The page source looks like this:<div class="codebox"><p>Code: </p><pre><code>&lt;body bgcolor="gray"&gt;Gott Nytt år 2004!&lt;br&gt;&lt;br&gt;&lt;a href="phpmyadmin/"&gt;PHP Myadmin&lt;/a&gt;&lt;br&gt;&lt;a href="upload/"&gt;Upload&lt;/a&gt;&lt;br&gt;&lt;a href="movies/"&gt;Movies&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href="mailto:t3ch@lajt.mine.nu"&gt;Kasta ett e-brev!&lt;/a&gt;</code></pre></div>I want output to be like:<div class="codebox"><p>Code: </p><pre><code>phpmyadmin/upload/movies/</code></pre></div>But only this get printed:<div class="codebox"><p>Code: </p><pre><code>phpmyadmin/</code></pre></div>//<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4315">t3ch^</a> — Tue Dec 30, 2003 6:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-12-30T11:46:25-04:00</updated>

		<published>2003-12-30T11:46:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31981#p31981</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31981#p31981"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31981#p31981"><![CDATA[
check out <a href="http://tcl.activestate.com/man/tcl8.4/TclCmd/http.htm" class="postlink">this</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Tue Dec 30, 2003 11:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[t3ch^]]></name></author>
		<updated>2003-12-30T11:34:01-04:00</updated>

		<published>2003-12-30T11:34:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31980#p31980</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31980#p31980"/>
		<title type="html"><![CDATA[Fetching data from www?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31980#p31980"><![CDATA[
Can some one give me some dockuments howto fetch data from www or maby even explain a little bit?<br><br>i whant to do a tcl script wich get data from a certain page and displays it on irc on a chanel, kinda like !google.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4315">t3ch^</a> — Tue Dec 30, 2003 11:34 am</p><hr />
]]></content>
	</entry>
	</feed>
