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

	<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>2011-04-30T16:22:51-04:00</updated>

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

		<entry>
		<author><name><![CDATA[marx2k]]></name></author>
		<updated>2011-04-30T16:22:51-04:00</updated>

		<published>2011-04-30T16:22:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96805#p96805</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96805#p96805"/>
		<title type="html"><![CDATA[Stock quotes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96805#p96805"><![CDATA[
I did as you suggested.<br><br>I got:<div class="codebox"><p>Code: </p><pre><code> Tcl error [prcMarketCommand]: can't read "data": no such variable</code></pre></div>Here's what the script looks like right now:<div class="codebox"><p>Code: </p><pre><code>package require httpbind PUB n !market prcMarketCommandproc prcMarketCommand {nick uhost hand chan text} {    set url http://www.londonstockexchange.com/home/homepage.htm    set agent [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]    set token [::http::geturl $url -timeout 10000]    switch -- [::http::status $token] {        "timeout" {putserv "PRIVMSG $chan :-error- http operation (timed out)"}        "error" {putserv "PRIVMSG $chan :-error- http error ([::http::error $token])"}        "ok" {            switch -- [http::ncode $token] {                200 {                    set rise \00303[encoding convertto utf-8 \u25B2]\003; set fall \00304[encoding convertto utf-8 \u25BC]\003                    set same \00312[encoding convertto utf-8 \u25BA]\003; set lost \00307[encoding convertto utf-8 \u25CF]\003                    regexp -- {\&lt;MARQUEE(.+?)\&lt;/MARQUEE} [::http::data $token] match data                    regsub -all -- {[\n\r]} $data ""                    array set identity {                        ftse "FTSE 100" dow "Dow Jones IA" nasdaq "NASDAQ 100"                        dax "DAX Index" cac "CAC 40 Index" nikkei "Nikkei Index"                    }                    set pattern \&lt;b\&gt;\[\\s\]\(\[^\&lt;\]\+?\)\&lt;/b\&gt;\[\\s\]\&lt;b\&gt;\&lt;\[^\&gt;\]\+\&gt;\(\[^\&lt;\]\+?\)\&lt;/font\&gt;                    foreach market [array names identity] {                        regexp -- [subst -nocommands -nobackslashes {$identity($market)$pattern}] $data match price($market) change($market)                        if {([info exists price($market)]) &amp;&amp; ([info exists change($market)])} {                            switch -- [string index $change($market) 0] {                                \+ {putserv "PRIVMSG $chan :$identity($market) $rise $price($market) $change($market)"}                                \- {putserv "PRIVMSG $chan :$identity($market) $fall $price($market) $change($market)"}                                default {putserv "PRIVMSG $chan :$identity($market) $same $price($market) $change($market)"}                            }                        } else {putserv "PRIVMSG $chan :$identity($market) $lost data unavailable"}                    }                }                default {putserv "PRIVMSG $chan :-error- http ncode ([http::ncode $token])"}            }        }    }    return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11518">marx2k</a> — Sat Apr 30, 2011 4:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2011-04-26T14:10:04-04:00</updated>

		<published>2011-04-26T14:10:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96774#p96774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96774#p96774"/>
		<title type="html"><![CDATA[Stock quotes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96774#p96774"><![CDATA[
The url (the 'set url' line) has changed thus why it's no longer working. Tried changing it to current main <a href="http://www.londonstockexchange.com/home/homepage.htm" class="postlink">address</a>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Apr 26, 2011 2:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[marx2k]]></name></author>
		<updated>2011-04-26T10:52:47-04:00</updated>

		<published>2011-04-26T10:52:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=96766#p96766</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=96766#p96766"/>
		<title type="html"><![CDATA[Stock quotes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=96766#p96766"><![CDATA[
This does not seem to function any longer. Could this be updated to work again? Would be great.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11518">marx2k</a> — Tue Apr 26, 2011 10:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-08T20:00:04-04:00</updated>

		<published>2009-03-08T20:00:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87778#p87778</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87778#p87778"/>
		<title type="html"><![CDATA[Stock quotes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87778#p87778"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>package require httpbind PUB n !market prcMarketCommandproc prcMarketCommand {nick uhost hand chan text} {    set url http://www.londonstockexchange.com/en-gb/home.htm    set agent [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]    set token [::http::geturl $url -timeout 10000]    switch -- [::http::status $token] {        "timeout" {putserv "PRIVMSG $chan :-error- http operation (timed out)"}        "error" {putserv "PRIVMSG $chan :-error- http error ([::http::error $token])"}        "ok" {            switch -- [http::ncode $token] {                200 {                    set rise \00303[encoding convertto utf-8 \u25B2]\003; set fall \00304[encoding convertto utf-8 \u25BC]\003                    set same \00312[encoding convertto utf-8 \u25BA]\003; set lost \00307[encoding convertto utf-8 \u25CF]\003                    regexp -- {\&lt;MARQUEE(.+?)\&lt;/MARQUEE} [::http::data $token] match data                    regsub -all -- {[\n\r]} $data ""                    array set identity {                        ftse "FTSE 100" dow "Dow Jones IA" nasdaq "NASDAQ 100"                        dax "DAX Index" cac "CAC 40 Index" nikkei "Nikkei Index"                    }                    set pattern \&lt;b\&gt;\[\\s\]\(\[^\&lt;\]\+?\)\&lt;/b\&gt;\[\\s\]\&lt;b\&gt;\&lt;\[^\&gt;\]\+\&gt;\(\[^\&lt;\]\+?\)\&lt;/font\&gt;                    foreach market [array names identity] {                        regexp -- [subst -nocommands -nobackslashes {$identity($market)$pattern}] $data match price($market) change($market)                        if {([info exists price($market)]) &amp;&amp; ([info exists change($market)])} {                            switch -- [string index $change($market) 0] {                                \+ {putserv "PRIVMSG $chan :$identity($market) $rise $price($market) $change($market)"}                                \- {putserv "PRIVMSG $chan :$identity($market) $fall $price($market) $change($market)"}                                default {putserv "PRIVMSG $chan :$identity($market) $same $price($market) $change($market)"}                            }                        } else {putserv "PRIVMSG $chan :$identity($market) $lost data unavailable"}                    }                }                default {putserv "PRIVMSG $chan :-error- http ncode ([http::ncode $token])"}            }        }    }    return 0}</code></pre></div><img src="http://i672.photobucket.com/albums/vv90/arfer/market.png" class="postimage" alt="Image"><br><br>SELL SELL SELL!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Mar 08, 2009 8:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[start]]></name></author>
		<updated>2009-03-04T21:37:02-04:00</updated>

		<published>2009-03-04T21:37:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87707#p87707</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87707#p87707"/>
		<title type="html"><![CDATA[Stock quotes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87707#p87707"><![CDATA[
Hello, <br><br>I need something more specific than the current stock scripts on the archive. The scripts that are available now only show one index at a time. Example: <br><br>&lt;user&gt; !dow<br>&lt;bot&gt; (Down Jones) 6800 -100 | 3/4/2009<br><br>I would like to display three indexes like so... <br><br>&lt;user&gt; !us<br>&lt;bot&gt; (Dow Jones 6800 -100 2%) (Nasdaq 2000 -100 5.3%) (S&amp;P 700 -20 1.3%) <br><br>I would also like to display percentage loss and gains. Lastly, I noticed the other scripts have if and else conditions to display the numbers that are positive are green and negative numbers are red.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10497">start</a> — Wed Mar 04, 2009 9:37 pm</p><hr />
]]></content>
	</entry>
	</feed>
