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

	<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>2008-12-17T12:39:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-17T12:39:29-04:00</updated>

		<published>2008-12-17T12:39:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86308#p86308</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86308#p86308"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86308#p86308"><![CDATA[
damn, I just tested it on 4 channels (defined 10) and all works,<br>hmm<br><br>watch out for BIG and small letters :&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Wed Dec 17, 2008 12:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-17T12:23:53-04:00</updated>

		<published>2008-12-17T12:23:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86307#p86307</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86307#p86307"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86307#p86307"><![CDATA[
Thanks - it's working perfectly... almost. If I'm setting three chans for "set *_chans {#chan1 #chan2}", the script won't work for the first two chans.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Wed Dec 17, 2008 12:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-16T18:43:16-04:00</updated>

		<published>2008-12-16T18:43:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86285#p86285</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86285#p86285"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86285#p86285"><![CDATA[
yap, if date will be exactly "N/A"<br><br>u can always use string match *smth* or regexp etc <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=10332">tomekk</a> — Tue Dec 16, 2008 6:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-16T16:32:09-04:00</updated>

		<published>2008-12-16T16:32:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86283#p86283</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86283#p86283"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86283#p86283"><![CDATA[
Would this be correct?<div class="codebox"><p>Code: </p><pre><code>proc check_proc { nick uhost hand chan arg } {   global check_url check_url_arg check_chans   if {[lsearch $check_chans $chan] != -1} {      set check_arg [lindex [split $arg] 0]      if {$check_arg != ""} {         set xml_data [grab_http_data 2 $check_url $check_url_arg $check_arg]         if {$xml_data != "error"} {            regsub -all "\t" $xml_data "" xml_data            regsub -all "\n" $xml_data "" xml_data            regsub -all "\r" $xml_data "" xml_data            regsub "&lt;field&gt;" $xml_data "&lt;field&gt;\n" xml_data            regsub "&lt;\/field&gt;" $xml_data "\n&lt;\/field&gt;" xml_data            set xml_data_field [lindex [split $xml_data "\n"] 1]            set xml_data_tags {color date nick homepage posts birthday mail userid}            foreach xml_tag $xml_data_tags {               regsub -nocase "&lt;$xml_tag&gt;| &lt;$xml_tag&gt;" [string trim $xml_data_field] "" xml_data_field               regsub -nocase "&lt;\/$xml_tag&gt;" [string trim $xml_data_field] "\n" xml_data_field            }            set xml_data_lines [split $xml_data_field "\n"]            set x_color [lindex $xml_data_lines 0]            set x_date [lindex $xml_data_lines 1]            set x_posts [lindex $xml_data_lines 4]            set x_birthday [lindex $xml_data_lines 5]            if { $x_date != "N/A" } {              putquick "PRIVMSG $chan :color: $x_color, date: $x_date, posts: $x_posts, birthday: $x_birthday"             } else {              putquick "PRIVMSG $chan :Nothing found!"            }         }      }   }} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Tue Dec 16, 2008 4:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-16T10:16:59-04:00</updated>

		<published>2008-12-16T10:16:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86269#p86269</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86269#p86269"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86269#p86269"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Author: tomekk# e-mail:  tomekk/@/oswiecim/./eu/./org# home page: http://tomekk.oswiecim.eu.org/## Version 0.2## This file is Copyrighted under the GNU Public License.# http://www.gnu.org/copyleft/gpl.html# lines chansset lines_chans {#chan1 #chan2}# check chansset check_chans {#chan1 #chan2}# search chansset search_chans {#chan1 #chan2}# url to list file, row by rowset list_url "http://localhost/list.txt"# url to check script, one rowset check_url "http://localhost/check.php"# url to search script, row by rowset search_url "http://localhost/search.php"# check_url script argument, # will be: $check_url?$check_url_arg=$query, http://localhost/check.php?value=$queryset check_url_arg "value"# search_url script argument,# will be: $search_url?$search_url_arg=$query, http://localhost/search.php?value=$queryset search_url_arg "value"#######################################################################bind pub - !lines lines_procbind pub - !check check_procbind pub - !search search_procpackage require httpproc lines_proc { nick uhost hand chan arg } {global list_url lines_chansif {[lsearch $lines_chans $chan] != -1} {set data_lines [grab_http_data 1 $list_url "" ""]if {$data_lines != "error"} {set lines_counter 0# we can count list with [llength] but we dont want to count empty lines { }foreach data_line [split $data_lines "\n"] {if {$data_line != ""} {incr lines_counter 1}}putquick "PRIVMSG $chan :[expr $lines_counter - 1]"}}}proc check_proc { nick uhost hand chan arg } {global check_url check_url_arg check_chansif {[lsearch $check_chans $chan] != -1} {set check_arg [lindex [split $arg] 0]if {$check_arg != ""} {set xml_data [grab_http_data 2 $check_url $check_url_arg $check_arg]if {$xml_data != "error"} {regsub -all "\t" $xml_data "" xml_dataregsub -all "\n" $xml_data "" xml_dataregsub -all "\r" $xml_data "" xml_dataregsub "&lt;field&gt;" $xml_data "&lt;field&gt;\n" xml_dataregsub "&lt;\/field&gt;" $xml_data "\n&lt;\/field&gt;" xml_dataset xml_data_field [lindex [split $xml_data "\n"] 1]set xml_data_tags {color date nick homepage posts birthday mail userid}foreach xml_tag $xml_data_tags {regsub -nocase "&lt;$xml_tag&gt;| &lt;$xml_tag&gt;" [string trim $xml_data_field] "" xml_data_fieldregsub -nocase "&lt;\/$xml_tag&gt;" [string trim $xml_data_field] "\n" xml_data_field}set xml_data_lines [split $xml_data_field "\n"]set x_color [lindex $xml_data_lines 0]set x_date [lindex $xml_data_lines 1]set x_posts [lindex $xml_data_lines 4]set x_birthday [lindex $xml_data_lines 5]putquick "PRIVMSG $chan :color: $x_color, date: $x_date, posts: $x_posts, birthday: $x_birthday"}}}}proc search_proc { nick uhost hand chan arg } {global search_url search_url_arg search_chansif {[lsearch $search_chans $chan] != -1} {set search_arg [lindex [split $arg] 0]if {$search_arg != ""} {set data_lines [grab_http_data 2 $search_url $search_url_arg $search_arg]if {$data_lines != "error"} {set lines_counter 0set data_lines [split $data_lines "\n"]foreach data_line $data_lines {if {$data_line != ""} {incr lines_counter 1}}if {$lines_counter &gt; 3} {set three_lines [lrange $data_lines 0 2]foreach one_line $three_lines {putquick "PRIVMSG $chan :$one_line"}set the_rest [expr $lines_counter - 3]putquick "PRIVMSG $chan :... And further $the_rest lines - $search_url?$search_url_arg=$search_arg"} else {foreach one_line $data_lines {putquick "PRIVMSG $chan :$one_line"}}}}}}proc grab_http_data { type url query arg } {set user_agent "http-query.tcl &lt;eggdrop script&gt;"set tiny_token [http::config -useragent $user_agent]if {$type == 1} {set tiny_token [http::geturl $url -timeout 10000]} else {# for longer queries should be ::http::formatQueryset proper_url "$url?$query=$arg"set tiny_token [http::geturl $proper_url -timeout 10000]}set html_data [http::data $tiny_token]if {$html_data != ""} {return $html_data} {return "error"}}putlog "http-query.tcl ver 0.1 by tomekk loaded"</code></pre></div>tested with your xml, output:<blockquote class="uncited"><div>15:15:31 &lt;@tomekk&gt; !check blah<br>15:15:31 &lt; botty&gt; color: blue, date: 19.12.08, posts: 46, birthday: N/A</div></blockquote>try :&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Tue Dec 16, 2008 10:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-16T08:35:51-04:00</updated>

		<published>2008-12-16T08:35:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86266#p86266</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86266#p86266"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86266#p86266"><![CDATA[
It's like this:<div class="codebox"><p>Code: </p><pre><code>&lt;?xml version='1.0' encoding='us-ascii' ?&gt;&lt;SEARCH&gt;&lt;field&gt;&lt;color&gt;blue&lt;/color&gt;&lt;date&gt;19.12.08&lt;/date&gt;&lt;nick&gt;tomekk&lt;/nick&gt;&lt;homepage&gt;egghelp.org&lt;/homepage&gt;&lt;posts&gt;46&lt;/posts&gt;&lt;birthday&gt;N/A&lt;/birthday&gt;&lt;mail&gt;egg@tomekk&lt;/mail&gt;&lt;userid&gt;1&lt;/userid&gt;&lt;/field&gt;&lt;/SEARCH&gt;</code></pre></div>And I just want to get the values from:<br>&lt;color&gt;&lt;/color&gt;<br>&lt;date&gt;&lt;/date&gt;<br>&lt;posts&gt;&lt;/posts&gt;<br>&lt;birthday&gt;&lt;/birthday&gt;<br><br>Edit: I'm sorry, it's the <strong class="text-strong">!check</strong> script. And btw, I want the same with N/A. if one (ore more) of the mentioned xml tags contains "N/A" I would like to respond "N/A". :-p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Tue Dec 16, 2008 8:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-16T08:10:45-04:00</updated>

		<published>2008-12-16T08:10:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86265#p86265</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86265#p86265"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86265#p86265"><![CDATA[
<blockquote class="uncited"><div>Hi there! The scripts is working great, but I was wondering if you could extend the !search script. I wan't to get xml data (&lt;field1&gt;&lt;/field1&gt; and &lt;field2&gt;&lt;/field2&gt; but not the rest - including such as "&lt;?xml version='1.0' encoding='us-ascii' ?&gt;" and so on.).<br><br>Thanks for the help this far! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"></div></blockquote>hey,<br><br>Paste here full example of this XML structure, I need to see it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Insert some fake data etc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Tue Dec 16, 2008 8:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-15T18:16:26-04:00</updated>

		<published>2008-12-15T18:16:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86253#p86253</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86253#p86253"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86253#p86253"><![CDATA[
Hi there! The scripts is working great, but I was wondering if you could extend the !search script. I wan't to get xml data (&lt;field1&gt;&lt;/field1&gt; and &lt;field2&gt;&lt;/field2&gt; but not the rest - including such as "&lt;?xml version='1.0' encoding='us-ascii' ?&gt;" and so on.).<br><br>Thanks for the help this far! <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=10344">JKM</a> — Mon Dec 15, 2008 6:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-10T14:35:34-04:00</updated>

		<published>2008-12-10T14:35:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86178#p86178</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86178#p86178"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86178#p86178"><![CDATA[
spanks! <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=10344">JKM</a> — Wed Dec 10, 2008 2:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-10T13:43:19-04:00</updated>

		<published>2008-12-10T13:43:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86177#p86177</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86177#p86177"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86177#p86177"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc check_proc { nick uhost hand chan arg } {        global check_url check_url_arg check_chans        if {[lsearch $check_chans $chan] != -1} {                set check_arg [lindex [split $arg] 0]                if {$check_arg != ""} {                        set one_data_line [grab_http_data 2 $check_url $check_url_arg $check_arg]                        if {$one_data_line != "error"} {                                if {$one_data_line != "  N/A  N/A  N/A  N/A  N/A  N/A  N/A  1  "} {                                        putquick "PRIVMSG $chan :$one_data_line"                                } else {                                        putquick "PRIVMSG $chan :Nothing found"                                }                        }                }        }}</code></pre></div>"error" should stay because this inform script when page get timeout or some connection problem<br><br>"  N/A  N/A  N/A  N/A  N/A  N/A  N/A  1  "  - when line will be exactly like this one, without "enters" etc then should work<br><br>When line includes some html  chars this should work too. (i mean whole line will be visible, with &lt;p&gt; etc tags.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Wed Dec 10, 2008 1:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-10T12:55:50-04:00</updated>

		<published>2008-12-10T12:55:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86176#p86176</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86176#p86176"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86176#p86176"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc check_proc { nick uhost hand chan arg } {global check_url check_url_arg check_chansif {[lsearch $check_chans $chan] != -1} {set check_arg [lindex [split $arg] 0]if {$check_arg != ""} {set one_data_line [grab_http_data 2 $check_url $check_url_arg $check_arg]if {$one_data_line != "error"} {putquick "PRIVMSG $chan :$one_data_line"}}}}</code></pre></div></div></blockquote>Again, thanks a lot! But I've got some questions.<br>1: I wan't to reply "Nothing found" if the line is "  N/A  N/A  N/A  N/A  N/A  N/A  N/A  1  " - so would this work?<div class="codebox"><p>Code: </p><pre><code>proc check_proc { nick uhost hand chan arg } {global check_url check_url_arg check_chansif {[lsearch $check_chans $chan] != -1} {set check_arg [lindex [split $arg] 0]if {$check_arg != ""} {set one_data_line [grab_http_data 2 $check_url $check_url_arg $check_arg]if {$one_data_line != "  N/A  N/A  N/A  N/A  N/A  N/A  N/A  1  "} {putquick "PRIVMSG $chan :$one_data_line"else {putquick "PRIVMSG $chan :Nothing found"}}}}}</code></pre></div>2. If the code got DOCTYPE, and if the lines at the html page is listed with &lt;p&gt;&lt;/p&gt;, will the html code also be visible?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Wed Dec 10, 2008 12:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-10T07:40:12-04:00</updated>

		<published>2008-12-10T07:40:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86168#p86168</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86168#p86168"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86168#p86168"><![CDATA[
<blockquote class="uncited"><div>This script should only print the first three lines at the page (if there is more than three lines). At the end it should echo "... And further XX (Total lines - 3) lines - <a href="http://url" class="postlink">http://url</a>". <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"></div></blockquote><div class="codebox"><p>Code: </p><pre><code># Author: tomekk# e-mail:  tomekk/@/oswiecim/./eu/./org# home page: http://tomekk.oswiecim.eu.org/## Version 0.1## This file is Copyrighted under the GNU Public License.# http://www.gnu.org/copyleft/gpl.html# lines chansset lines_chans {#chan1 #chan2}# check chansset check_chans {#chan1 #chan2}# search chansset search_chans {#chan1 #chan2}# url to list file, row by rowset list_url "http://localhost/list.txt"# url to check script, one rowset check_url "http://localhost/check.php"# url to search script, row by rowset search_url "http://localhost/search.php"# check_url script argument, # will be: $check_url?$check_url_arg=$query, http://localhost/check.php?value=$queryset check_url_arg "value"# search_url script argument,# will be: $search_url?$search_url_arg=$query, http://localhost/search.php?value=$queryset search_url_arg "value"#######################################################################bind pub - !lines lines_procbind pub - !check check_procbind pub - !search search_procpackage require httpproc lines_proc { nick uhost hand chan arg } {global list_url lines_chansif {[lsearch $lines_chans $chan] != -1} {set data_lines [grab_http_data 1 $list_url "" ""]if {$data_lines != "error"} {set lines_counter 0# we can count list with [llength] but we dont want to count empty lines { }foreach data_line [split $data_lines "\n"] {if {$data_line != ""} {incr lines_counter 1}}putquick "PRIVMSG $chan :[expr $lines_counter - 1]"}}}proc check_proc { nick uhost hand chan arg } {global check_url check_url_arg check_chansif {[lsearch $check_chans $chan] != -1} {set check_arg [lindex [split $arg] 0]if {$check_arg != ""} {set one_data_line [grab_http_data 2 $check_url $check_url_arg $check_arg]if {$one_data_line != "error"} {putquick "PRIVMSG $chan :$one_data_line"}}}}proc search_proc { nick uhost hand chan arg } {global search_url search_url_arg search_chansif {[lsearch $search_chans $chan] != -1} {set search_arg [lindex [split $arg] 0]if {$search_arg != ""} {set data_lines [grab_http_data 2 $search_url $search_url_arg $search_arg]if {$data_lines != "error"} {set lines_counter 0set data_lines [split $data_lines "\n"]foreach data_line $data_lines {if {$data_line != ""} {incr lines_counter 1}}if {$lines_counter &gt; 3} {set three_lines [lrange $data_lines 0 2]foreach one_line $three_lines {putquick "PRIVMSG $chan :$one_line"}set the_rest [expr $lines_counter - 3]putquick "PRIVMSG $chan :... And further $the_rest lines - $search_url?$search_url_arg=$search_arg"} else {foreach one_line $data_lines {putquick "PRIVMSG $chan :$one_line"}}}}}}proc grab_http_data { type url query arg } {set user_agent "http-query.tcl &lt;eggdrop script&gt;"set tiny_token [http::config -useragent $user_agent]if {$type == 1} {set tiny_token [http::geturl $url -timeout 10000]} else {# for longer queries should be ::http::formatQueryset proper_url "$url?$query=$arg"set tiny_token [http::geturl $proper_url -timeout 10000]}set html_data [http::data $tiny_token]if {$html_data != ""} {return $html_data} {return "error"}}putlog "http-query.tcl ver 0.1 by tomekk loaded"</code></pre></div>try :&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Wed Dec 10, 2008 7:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-09T19:30:26-04:00</updated>

		<published>2008-12-09T19:30:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86160#p86160</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86160#p86160"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86160#p86160"><![CDATA[
This script should only print the first three lines at the page (if there is more than three lines). At the end it should echo "... And further XX (Total lines - 3) lines - <a href="http://url" class="postlink">http://url</a>". <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=10344">JKM</a> — Tue Dec 09, 2008 7:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2008-12-09T16:10:06-04:00</updated>

		<published>2008-12-09T16:10:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86157#p86157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86157#p86157"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86157#p86157"><![CDATA[
<blockquote class="uncited"><div>Thanks a lot! I can't - unfortunately - test it before friday (when I'm ordering my shell).<br><br>By the way, could you please make another thing 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>!search xx -&gt; paste the result from mypage.com?search.php?f=xx. IF the page shows more than three rows (ex. 20 lines), it should past it like this:<br><br>row1<br>row2<br>row3<br>... And further 17 (20-3) lines: mypage.com?search.php?f=xx</div></blockquote>after 3 lines script should write link to this or this script should print all 20 lines?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Tue Dec 09, 2008 4:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JKM]]></name></author>
		<updated>2008-12-09T15:26:29-04:00</updated>

		<published>2008-12-09T15:26:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86156#p86156</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86156#p86156"/>
		<title type="html"><![CDATA[Getting values from a url (and count lines) - XML!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86156#p86156"><![CDATA[
Thanks a lot! I can't - unfortunately - test it before friday (when I'm ordering my shell).<br><br>By the way, could you please make another thing 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>!search xx -&gt; paste the result from mypage.com?search.php?f=xx. IF the page shows more than three rows (ex. 20 lines), it should past it like this:<br><br>row1<br>row2<br>row3<br>... And further 17 (20-3) lines: mypage.com?search.php?f=xx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10344">JKM</a> — Tue Dec 09, 2008 3:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
