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

	<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>2003-10-09T00:08:45-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BarkerJr]]></name></author>
		<updated>2003-10-09T00:08:45-04:00</updated>

		<published>2003-10-09T00:08:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28187#p28187</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28187#p28187"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28187#p28187"><![CDATA[
You really don't want to use exec on anything slow.  Use open and use a pipe.  Then you can read from the fd that open returns.<br><br>e.g.:<br>set fd [open "|wget <a href="http://www.cnn.com/" class="postlink">http://www.cnn.com/</a>" r]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2933">BarkerJr</a> — Thu Oct 09, 2003 12:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-08T21:52:57-04:00</updated>

		<published>2003-10-08T21:52:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28181#p28181</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28181#p28181"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28181#p28181"><![CDATA[
<blockquote class="uncited"><div>the problem with lynx is that there is no real timeout<br>i had some of my scripts with lynx too, but when the webpage to slow etc the exec just took some minutes -&gt; bot times out....</div></blockquote>what would be the best method here, does fetch or wget have a good timeout?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Wed Oct 08, 2003 9:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Syntax]]></name></author>
		<updated>2003-10-05T14:39:49-04:00</updated>

		<published>2003-10-05T14:39:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27991#p27991</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27991#p27991"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27991#p27991"><![CDATA[
Are there any good tutorials on the subject parsing files/html<br>???<br>if there is i would reallt like an url.<br>or if someone could help me that would be good too.<br>prefrably real time like chat on ICQ or IRC..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3956">Syntax</a> — Sun Oct 05, 2003 2:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-10-04T00:50:32-04:00</updated>

		<published>2003-10-04T00:50:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27894#p27894</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27894#p27894"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27894#p27894"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc status_callback {sock} {   global inifilestatus  set data [egghttp:data $sock]   egghttp:cleanup $sock   regsub -all "\n" $data "" data   regsub -all "&lt;br&gt;" $data "\n" data   foreach line [split $data \n] {     if {[string match "*Deception*Up*" $line]} {       set item [join [lindex [split $line] 1]]      ini_write $inifilestatus server status $item    }    if {[string match "*Deception*Down*" $line]} {       set item [join [lindex [split $line] 1]]      ini_write $inifilestatus server status $item    }    return 0  } } </code></pre></div>Ok so when it checks the status, its supposed to use my ini_write proc.  But the problem is, is its not even getting the line, I'm not sure If its even getting the page properly.<br><br>To call it in another script, i do this:<div class="codebox"><p>Code: </p><pre><code>set sock [egghttp:geturl chronicle.ubi.com/ status_callback]set server_status [ini_read $inifilestatus server status]</code></pre></div>But thats totally wrong as I've never ever used this http stuff in a script before so i'm totally lost.</div></blockquote>  Because egghttp works in non-blocking mode (ie. it won't freeze up your bot), your 'set server_status' line will most likely be called before the callback proc gets called.. If you want to set anything, it will have to be within the callback proc itself... To verify it is working, add 'putlog' statements in your callback proc, and stay in your bot's partyline while the bot tries to connect to the site and watch what is going on.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Sat Oct 04, 2003 12:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-03T18:39:18-04:00</updated>

		<published>2003-10-03T18:39:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27882#p27882</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27882#p27882"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27882#p27882"><![CDATA[
anyone able to help?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Fri Oct 03, 2003 6:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-03T08:20:11-04:00</updated>

		<published>2003-10-03T08:20:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27875#p27875</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27875#p27875"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27875#p27875"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc status_callback {sock} {   global inifilestatus  set data [egghttp:data $sock]   egghttp:cleanup $sock   regsub -all "\n" $data "" data   regsub -all "&lt;br&gt;" $data "\n" data   foreach line [split $data \n] {     if {[string match "*Deception*Up*" $line]} {       set item [join [lindex [split $line] 1]]      ini_write $inifilestatus server status $item    }    if {[string match "*Deception*Down*" $line]} {       set item [join [lindex [split $line] 1]]      ini_write $inifilestatus server status $item    }    return 0  } } </code></pre></div>Ok so when it checks the status, its supposed to use my ini_write proc.  But the problem is, is its not even getting the line, I'm not sure If its even getting the page properly.<br><br>To call it in another script, i do this:<div class="codebox"><p>Code: </p><pre><code>set sock [egghttp:geturl chronicle.ubi.com/ status_callback]set server_status [ini_read $inifilestatus server status]</code></pre></div>But thats totally wrong as I've never ever used this http stuff in a script before so i'm totally lost.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Fri Oct 03, 2003 8:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-10-03T04:28:13-04:00</updated>

		<published>2003-10-03T04:28:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27863#p27863</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27863#p27863"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27863#p27863"><![CDATA[
the problem with lynx is that there is no real timeout<br>i had some of my scripts with lynx too, but when the webpage to slow etc the exec just took some minutes -&gt; bot times out....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Fri Oct 03, 2003 4:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-10-03T03:34:02-04:00</updated>

		<published>2003-10-03T03:34:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27859#p27859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27859#p27859"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27859#p27859"><![CDATA[
<blockquote class="uncited"><div>Oh and this is the line on the page that I am trying to get<br><br>&lt;tr&gt;&lt;td&gt;  &lt;/td&gt;&lt;td&gt;&lt;a href="/WorldMap/CityList.htm?World=Deception"&gt;Deception&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;font color="green"&gt;&lt;b&gt;Up&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;td&gt;  &lt;/td&gt;&lt;/tr&gt;</div></blockquote>if you're on a *nix system with lynx, you can use the simple way I often use:<div class="codebox"><p>Code: </p><pre><code>file delete -force $usertempset fs [open $usertemp w]puts $fs [exec $lynx -preparsed -dump $rub]close $fs</code></pre></div>and you don't have any html code in $fs <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=691">CrazyCat</a> — Fri Oct 03, 2003 3:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2003-10-02T22:21:15-04:00</updated>

		<published>2003-10-02T22:21:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27854#p27854</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27854#p27854"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27854#p27854"><![CDATA[
<blockquote class="uncited"><div>Oh and this is the line on the page that I am trying to get<br><br>&lt;tr&gt;&lt;td&gt;  &lt;/td&gt;&lt;td&gt;&lt;a href="/WorldMap/CityList.htm?World=Deception"&gt;Deception&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;font color="green"&gt;&lt;b&gt;Up&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;td&gt;  &lt;/td&gt;&lt;/tr&gt;</div></blockquote>If that's the line you are trying to get, then your string match is invalid..<br><div class="codebox"><p>Code: </p><pre><code>if {[string match "*Deception Up*" $line]} { </code></pre></div>should be:<br><div class="codebox"><p>Code: </p><pre><code>if {[string match "*Deceoption*Up*" $line]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Thu Oct 02, 2003 10:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-02T21:33:42-04:00</updated>

		<published>2003-10-02T21:33:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27853#p27853</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27853#p27853"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27853#p27853"><![CDATA[
Oh and this is the line on the page that I am trying to get<br><br>&lt;tr&gt;&lt;td&gt;  &lt;/td&gt;&lt;td&gt;&lt;a href="/WorldMap/CityList.htm?World=Deception"&gt;Deception&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;font color="green"&gt;&lt;b&gt;Up&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;td&gt;  &lt;/td&gt;&lt;/tr&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Thu Oct 02, 2003 9:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-02T21:29:53-04:00</updated>

		<published>2003-10-02T21:29:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27852#p27852</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27852#p27852"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27852#p27852"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc status_callback {sock} {   global inifilestatus  set data [[b]egghttp[/b]:data $sock]   [b]egghttp[/b]:cleanup $sock   regsub -all "\n" $data "" data   regsub -all "&lt;br&gt;" $data "\n" data   foreach line [split $data \n] {     if {[string match "*Deception Up*" $line]} {       set item [join [lindex [split $line] 1]]    }    return 0  } } </code></pre></div>That probably looks totally wrong, i'm not sure it even works, or if I'm calling it right.<br><br>The page has multiple words "Deception" in it, so I'm hoping that *Deception Up* would work, then just write another if statement for Down servers.<br><br>But my problem is now, I can't get the data from that proc back to a var so I can use the !status command.<br><br>So now I just need help fixing that messy code, and setting the var in the !status proc.  Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Thu Oct 02, 2003 9:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-02T20:34:03-04:00</updated>

		<published>2003-10-02T20:34:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27851#p27851</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27851#p27851"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27851#p27851"><![CDATA[
Ok, I can't even get this connect stuff down, how do I connect to the site, search for the line, take arg 1 from that line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Thu Oct 02, 2003 8:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2003-10-02T11:10:56-04:00</updated>

		<published>2003-10-02T11:10:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27835#p27835</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27835#p27835"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27835#p27835"><![CDATA[
If you catch the html page, so it's allright.<br>Just put each line in $line and make<div class="codebox"><p>Code: </p><pre><code>set present [string first "Deception" $line]if {$present != 0} {# it's ok, you have your line} else {# it is not the good line}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Oct 02, 2003 11:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Darkj]]></name></author>
		<updated>2003-10-02T08:20:40-04:00</updated>

		<published>2003-10-02T08:20:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27829#p27829</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27829#p27829"/>
		<title type="html"><![CDATA[Parsing HTML]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27829#p27829"><![CDATA[
Basically, I have zero idea how to even start this.  I wanna make a server status script for my bot that would read off a webpage (<a href="http://chronicle.ubi.com/" class="postlink">http://chronicle.ubi.com/</a>).  Now if you view that webpage, you will see on the right about 10 servers.  I would like to be able to get the status for the one server called Deception.  So basically i just wanna see if beside Deception, if it says UP or Down.<br><br>I have got the http script loaded, but after trying the parsing I get totally lost, if someone can provide some insight, that would be greatly appreciated.  Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3459">Darkj</a> — Thu Oct 02, 2003 8:20 am</p><hr />
]]></content>
	</entry>
	</feed>
