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

	<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-10-05T11:20:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[jinsonxu]]></name></author>
		<updated>2008-10-05T11:20:53-04:00</updated>

		<published>2008-10-05T11:20:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85423#p85423</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85423#p85423"/>
		<title type="html"><![CDATA[HTTP choking on ^ character in URL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85423#p85423"><![CDATA[
Well, i don't use the manual mapping solution. Simply encoded the query with ::http::formatQuery and it works. <br><br>Not sure whether i got that right. Am new to TCL. <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=10252">jinsonxu</a> — Sun Oct 05, 2008 11:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-08-17T17:02:52-04:00</updated>

		<published>2007-08-17T17:02:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75350#p75350</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75350#p75350"/>
		<title type="html"><![CDATA[HTTP choking on ^ character in URL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75350#p75350"><![CDATA[
Don't feed http://  to the string map and it won't mangle your input var.. Just use the url without http://  until you're giving the data to geturl (you can stuff http://$input into geturl, the http://  is always present so it can be hard-coded)<br><br>And yeah my example got word-wrapped by the forum's editor so it might've been a little messed up.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Aug 17, 2007 5:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pitbull]]></name></author>
		<updated>2007-08-17T15:00:41-04:00</updated>

		<published>2007-08-17T15:00:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75344#p75344</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75344#p75344"/>
		<title type="html"><![CDATA[HTTP choking on ^ character in URL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75344#p75344"><![CDATA[
Thanks, however now I get the error<br> [13:55] Tcl error [pub:quote]: char map list unbalanced<br><br>I don't understand the charmap thing to debug it myself <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"><br><br>Edit: Well after much studying of the charmap var, I realized there was a space missing in front of the | char. Also, I removed the remapping of the : and /, because I got the error Tcl error [pub:quote]: Unsupported URL: http%3A%2F%2Ffinance.yahoo.com%2Fd%2Fquotes.csv%3Fs%3D%5ESPC%26f%3Dst5l9c6p4b1a3%26e%3D.csv<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9222">pitbull</a> — Fri Aug 17, 2007 3:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-08-17T13:54:04-04:00</updated>

		<published>2007-08-17T13:54:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75343#p75343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75343#p75343"/>
		<title type="html"><![CDATA[HTTP choking on ^ character in URL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75343#p75343"><![CDATA[
You have to translate those chars into html before you can use them. Typically we use string map to do that, such as:<br><div class="codebox"><p>Code: </p><pre><code>proc myproc {n u h c t} {        set myurl [string map $::mapvar $inputvar]        # geturl or whatever after translating the input (inputvar)}# String map basically uses pairs, the char to be changed, and then char to change it to.. Some chars are quoted to protect them or indicate they all go together. Also note the $:: above refers to global space (outside of the proc) so $::mapvar means this setting below:set mapvar {"\ " +  : %3A  \\ %5C%5C  \[ %5B  \] %5D  \# %23  \" %22    \' %27  ! %21  @ %40 $ %24  \( %28  \) %29  ~  %7E  `  %60  %  %25   ^   %5E  \&amp; %26  = %3D  + %2B| %7C  \{ %7B  \} %7D  /  %2F  \? %3F  ,  %2C   &lt;   %3C   &gt; %3E  ; %3B}# ignore the word wrap above, string map doesn't care as long as the var has an even number of chars/words.</code></pre></div>Thats a good collection of strings to handle most html input, there's other examples around, much more extensive ones (look at my dictionary script in the archive for example, that has over 100 chars in its map.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Fri Aug 17, 2007 1:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[pitbull]]></name></author>
		<updated>2007-08-17T13:12:42-04:00</updated>

		<published>2007-08-17T13:12:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75340#p75340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75340#p75340"/>
		<title type="html"><![CDATA[HTTP choking on ^ character in URL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75340#p75340"><![CDATA[
I am modifying a script that retrieves stock quotes from yahoo finance. It works for most symbols, such as DJI. however, some require a ^ infront of the stock, like ^IXIC . Eggdrop spits out an error when that symbol is used: <br><br>[11:49] Tcl error [pub:quote]: Illegal characters in URL path<br><br>This is the part of the script that retrieves the data:<blockquote class="uncited"><div>                set stock [string toupper [lindex $arg 0]]<br>                set query "<a href="http://finance.yahoo.com/d/quotes.csv?s=$stock&amp;f=st5l9c6p4b1a3&amp;e=.csv" class="postlink">http://finance.yahoo.com/d/quotes.csv?s ... 1a3&amp;e=.csv</a>"<br>                set token [http::geturl $query]<br>                set all [http::data $token]<br>                regsub -all \" $all "" all<br>                set all [split $all ","]</div></blockquote>so if $query contains a ^, it chokes. How can I get around this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9222">pitbull</a> — Fri Aug 17, 2007 1:12 pm</p><hr />
]]></content>
	</entry>
	</feed>
