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

	<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-06-16T15:02:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-06-16T15:02:12-04:00</updated>

		<published>2004-06-16T15:02:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37469#p37469</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37469#p37469"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37469#p37469"><![CDATA[
I changed 1.0 to 1.1 just like you and added puts $s "Connection: close" right below it.<br><br>Then I did:<br><br>set token [http::geturl <a href="http://localhost/test.html" class="postlink">http://localhost/test.html</a> -headers <ul><li>]<br>puts [http::data $token]<br><br>It worked for me.</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Jun 16, 2004 3:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DayCuts]]></name></author>
		<updated>2004-06-16T01:45:58-04:00</updated>

		<published>2004-06-16T01:45:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37437#p37437</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37437#p37437"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37437#p37437"><![CDATA[
Ic, yeah looking at the http tcl it uses 1.0.. I changed 1 occurance of 1.0 to 1.1 in \lib\tcl8.4\http2.4\http.tcl<blockquote class="uncited"><div>You might have to add a bit to it too, like the Host header (I think) and Connection: close.</div></blockquote>Where would i change this in the http tcl?<br><br>What i did is this.. <br>change: puts $s "$how $srvurl HTTP/1.0" to puts $s "$how $srvurl HTTP/1.1"<br>added line putlog "$key: $value" in the -headers<br>added line puts $s "Connection: close" immediately after the the foreach for the -headers, this succesfully send info to the consol, so i know its processing the range: bytes.  However it still transfers the entire file....<br><br>Im totaly lost, is their another way? user mentioned using -bloacksize and -progress? (but as i said before i don't full understand how to implement -progress)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5073">DayCuts</a> — Wed Jun 16, 2004 1:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-06-15T23:58:56-04:00</updated>

		<published>2004-06-15T23:58:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37434#p37434</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37434#p37434"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37434#p37434"><![CDATA[
I'm pretty sure Range will work with any file, but you have to be using http 1.1. Normally the http package uses http 1.0. So you have to modify it a bit. Find the 1.0 and change it to 1.1. You might have to add a bit to it too, like the Host header (I think) and Connection: close.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Jun 15, 2004 11:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DayCuts]]></name></author>
		<updated>2004-06-15T16:47:27-04:00</updated>

		<published>2004-06-15T16:47:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37428#p37428</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37428#p37428"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37428#p37428"><![CDATA[
<blockquote class="uncited"><div>It's -headers "Range bytes=0-10"<br>The http package will properly format it with a : when it sends to server</div></blockquote>I tried this also. : )<br><br>As i mentioned in my first post, this is a .csv file i am accesing, not an average html page, this is probably why the html headers are ignored.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5073">DayCuts</a> — Tue Jun 15, 2004 4:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-06-15T16:45:42-04:00</updated>

		<published>2004-06-15T16:45:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37427#p37427</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37427#p37427"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37427#p37427"><![CDATA[
<blockquote class="uncited"><div>I tried using -headers "Range: bytes=0-10" in the http geturl but it was unsuccesful so i assume the server doesn't allow byte rangers.</div></blockquote>It's -headers "Range bytes=0-10"<br>The http package will properly format it with a : when it sends to server<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Tue Jun 15, 2004 4:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DayCuts]]></name></author>
		<updated>2004-06-15T16:42:38-04:00</updated>

		<published>2004-06-15T16:42:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37426#p37426</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37426#p37426"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37426#p37426"><![CDATA[
<blockquote class="uncited"><div>yeah..that's a good idea as you'll also avoid wasting lots of bandwidth transfering data you don't want/need.</div></blockquote>This is what i was wanting to do in the first place.. not transfer un-needed data.<br><br>I tried using -headers "Range: bytes=0-10" in the http geturl but it was unsuccesful so i assume the server doesn't allow byte rangers.<br><br>Also spent awhile playing with your method, user.  It made almost no difference than my original code, accept that it organised the data a little different, still transfered the entire file.  Which is what i am trying to avoid.<br><div class="codebox"><p>Code: </p><pre><code>  if {$text == ""} {    set token [::http::geturl $itrurlg]    set content [::http::data $token]    ::http::cleanup $content    regsub -all -- {,} $content { } cont2    list $cont2    # for debug purposes    putlog "[lrange $cont2 0 end]"    return 0  } else {</code></pre></div>Sample of content<div class="codebox"><p>Code: </p><pre><code>Date,Rating,Latency,Loss13:25 6/15/2004,85,145,213:20 6/15/2004,85,144,2</code></pre></div>the raw data is updated every 5 minutes, the only information i need is line no. 2<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5073">DayCuts</a> — Tue Jun 15, 2004 4:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-06-15T15:54:08-04:00</updated>

		<published>2004-06-15T15:54:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37424#p37424</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37424#p37424"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37424#p37424"><![CDATA[
<blockquote class="uncited"><div>Another thing is to use the regular form and send the http byte range request header.</div></blockquote>yeah..that's a good idea as you'll also avoid wasting lots of bandwidth transfering data you don't want/need.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jun 15, 2004 3:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2004-06-15T15:36:06-04:00</updated>

		<published>2004-06-15T15:36:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37423#p37423</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37423#p37423"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37423#p37423"><![CDATA[
Another thing is to use the regular form and send the http byte range request header.<br><br>It's like:<br><br>Range: bytes=0-100<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Tue Jun 15, 2004 3:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-06-15T15:19:55-04:00</updated>

		<published>2004-06-15T15:19:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37422#p37422</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37422#p37422"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37422#p37422"><![CDATA[
I took another look at that manual page and noticed another option that seems more suitable for your needs:  <a href="http://tcl.tk/man/tcl8.5/TclCmd/http.htm#M17" class="postlink">-handler</a><div class="codebox"><p>Code: </p><pre><code>package require httpproc yourCallback {sock tok} {while {[gets $sock line]==0} continue;# read untill we get a non-empty line or eofputs $line;# you probably want to do something else here :)http::reset $tok;# i'm not sure this one's needed, but I included it anyway :Phttp::cleanup $tok;# this one's mandatory}http::geturl http://www.your.url/ -handler yourCallback -command nah -timeout 20000</code></pre></div>the -command thing is just a hack to avoid blocking (and nasty error messages because of the cleanup performed before geturl returns <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jun 15, 2004 3:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DayCuts]]></name></author>
		<updated>2004-06-15T14:21:44-04:00</updated>

		<published>2004-06-15T14:21:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37419#p37419</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37419#p37419"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37419#p37419"><![CDATA[
Hmm, can you give me an example of the syntax for this?  This is what i had before my original post, however it still transfers the entire page of data.  This is my first script using the http package so i am sure i do not understand the proper usage and syntax of it all.<div class="codebox"><p>Code: </p><pre><code>set token [::http::geturl $itrurlg -blocksize 50]</code></pre></div>I have read the -progress help, however i still don't quite understand proper use and syntax.  So am a little lost on how to combine the two.  The information after the first break is not at all needed, so stopping after the first block is what i am trying to do.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5073">DayCuts</a> — Tue Jun 15, 2004 2:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2004-06-15T12:00:01-04:00</updated>

		<published>2004-06-15T12:00:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37409#p37409</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37409#p37409"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37409#p37409"><![CDATA[
<a href="http://tcl.tk/man/tcl8.5/TclCmd/http.htm#M14" class="postlink">-blocksize</a> combined with <a href="http://tcl.tk/man/tcl8.5/TclCmd/http.htm#M19" class="postlink">-progress</a> should do the trick.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jun 15, 2004 12:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DayCuts]]></name></author>
		<updated>2004-06-15T08:48:56-04:00</updated>

		<published>2004-06-15T08:48:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37402#p37402</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37402#p37402"/>
		<title type="html"><![CDATA[http geturl 'limiting'?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37402#p37402"><![CDATA[
I am writing a tcl script to return certain information from a .csv on a website using the http package.  Is there a way to limit the amount of bytes the script will read from the file.  This file can become quite large, as such using normal http geturl can be slow to respond (due to reading the entire file).  It would be much more efficient if i could just read the first XX bytes or X lines, since the most updated information that the script will be using is in the first few lines.<br><br>Any and all help much appreciated, thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5073">DayCuts</a> — Tue Jun 15, 2004 8:48 am</p><hr />
]]></content>
	</entry>
	</feed>
