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

	<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>2023-11-23T00:07:15-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-11-23T00:07:15-04:00</updated>

		<published>2023-11-23T00:07:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112259#p112259</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112259#p112259"/>
		<title type="html"><![CDATA[Re: stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112259#p112259"><![CDATA[
Hello Spike The script has been flawless just recently started reporting a strange error <br><br>&lt;ASX&gt; Invalid Company Symbol:  SLC<br><br>When trying to search any company <br><br>Not sure if yahoo has done something to their site<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12911">rainman</a> — Thu Nov 23, 2023 12:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-02-14T04:49:04-04:00</updated>

		<published>2023-02-14T04:49:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111680#p111680</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111680#p111680"/>
		<title type="html"><![CDATA[Re: ausStocks.tcl version 0.3  10Feb2023]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111680#p111680"><![CDATA[
Thanks Spike once again man, you're an awesome coder <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=12911">rainman</a> — Tue Feb 14, 2023 4:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-02-13T14:44:10-04:00</updated>

		<published>2023-02-13T14:44:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111677#p111677</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111677#p111677"/>
		<title type="html"><![CDATA[ausStocks.tcl version 0.3  10Feb2023]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111677#p111677"><![CDATA[
Version 0.3  tries to make this script a little more user friendly:<br> 1) script will now follow the redirect to the "Similar Symbol Lookup" page.<br> 2) use  .chanset #channel +asx  to enable this script by channel.<br> 3) and/or use the new channel setting:  set asx(chan) "#chan #anotherchan"<br> 4) can now use a company list file to limit invalid query symbols.<br> 5) added public error messages for all  ::http::geturl issues.<br> 6) and lots of other small tweeks.<br><br><div class="codebox"><p>Code: </p><pre><code>##########  ausStocks.tcl  ver. 0.3  by SpiKe^^  ########## 10Feb2023 ############ Version 0.3  tries to make this script a little more user friendly:# 1) script will now follow the redirect to the "Similar Symbol Lookup" page.# 2) use  .chanset #channel +asx  to enable this script by channel.# 3) and/or use the new channel setting:  set asx(chan) "#chan #anotherchan"# 4) can now use a company list file to limit invalid query symbols.# 5) added public error messages for all  ::http::geturl issues.# 6) and lots of other small tweeks.################## Version History #################### Version 0.2 added some bare minimum sanity checks w/ reporting:# 1) restricts user input to 3 - 6 alphanumeric characters.# 2) adds some error checking on the http connection &amp; get.# 3) put the entire script code in the namespace ::ausStocks::# public command syntax:  !asx &lt;symbol&gt;# example:  !asx csl######################################################namespace eval ausStocks {   variable asxpackage require httppackage require tlssetudef flag asx   ;# &lt;= Use  .chanset #chan +asx  to enable this script by channel.################### begin settings #################### set active channel(s) for this script  (or set empty to only use .chanset #ch +asx)#  or use:  set asx(chan) "*"  to make the script active in all bot channels.# note:  the channels set here can not be disabled by using  .chanset #ch -asxset asx(chan) ""# script logo  (placed before almost every line sent to the channel)set asx(logo) "\00306\[ASX\]\003 "# this filename is read at: source scripts/ausStocks.tcl#  and makes the namespaced variable:  $::ausStocks::asx(companydict).set asx(companylist_filename) "scripts/ausStocks.companylist.txt"############ end settings ############ end settings ############################################################################::http::register https 443 {::tls::socket -autoservername true}#::http::register https 443 [list ::tls::socket -servername au.finance.yahoo.com]bind pub - !asx [namespace current]::bindpubproc bindpub {nk uh hn ch tx} {   variable asx  set c [string tolower $ch]  if {![channel get $ch asx] &amp;&amp; ("*" ni $asx(chan)) &amp;&amp; ($c ni $asx(chan))} {    return 0  }  set tx [string trimright [string toupper [lindex [split [string trim $tx]] 0]] "."]  if {[matchstr "*.*" $tx]} {   set tmp [split $tx "."]    if {[llength $tmp] &gt; 2 || [lindex $tmp 1] ne "AX"} {      puthelp "PRIVMSG $ch :$asx(logo)Invalid Company Symbol: \002${tx}\002"      return 0    }    set sym [lindex $tmp 0]  } else {   set sym $tx   }  if {[string length $sym] ni {2 3 4 5 6} || [regexp {[^0-9A-Z]} $sym]} {    set say "$asx(logo)Command syntax:  \002!asx &lt;symbol&gt;\002"    puthelp "PRIVMSG $ch :$say  example:  \002!asx csl\002"    return 0  }  if {$asx(companydict) ne ""} {    if {![dict exists $asx(companydict) $sym]} {      set say "$asx(logo)Invalid Company Symbol: \002${sym}\002"      puthelp "PRIVMSG $ch :$say (symbol not in the $asx(companylist_filename) file.)"      return 0    }  }  set addr "https://au.finance.yahoo.com"  set address "${addr}/quote/${sym}.AX?p=${sym}.AX"  set uagent "Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"  set emap [list "\n" " | "]  foreach try {1 2} {  ::http::config -useragent $uagent    if {[catch {::http::geturl $address -timeout 7500} tok]} {      set err "1 ::http::geturl error: [string map $emap $tok]"    } elseif {[::http::status $tok] ne "ok"} {      set err "2 TCP error: [::http::status $tok]"    } else {   set ncode [::http::ncode $tok]      if {($try == 1 &amp;&amp; $ncode ni {200 302}) || ($try == 2 &amp;&amp; $ncode != 200)} {        set err "3 HTTP error: [::http::code $tok]"      }    }    if {$try == 1 &amp;&amp; [info exists ncode] &amp;&amp; $ncode == 302} {      upvar #0 $tok state      if {[dict exists $state(meta) location]} {        set loc [dict get $state(meta) location]        if {[matchstr "/lookup*" $loc]} {   set address "${addr}$loc"          ::http::cleanup $tok  ;   unset tok  ;   unset ncode          continue        }        set err "5 Redirect error: state(meta) 'location' not as expected ( $loc )."      } else {        set err "4 Redirect error: Unable to find 'location' in state(meta)."      }    }    break  }  if {[info exists err]} {   putlog "$asx(logo) [string range $err 2 end]"    if {[string index $err 0] &gt; 1} {   ::http::cleanup $tok   }    puthelp "PRIVMSG $ch :$asx(logo)Unable to get the requested data. Try again later."    return 0  }  set html [::http::data $tok]  ;   ::http::cleanup $tok  set html [join [lrange [split $html "\n"] 4 6] {}]  # is redirected 302 #  if {$try == 2} {   set similarto ""  ;   set allcount ""  ;   set simdict {}    regexp {&lt;span&gt;Symbols similar to (.*?)&lt;/span&gt;&lt;/h2&gt;(.*)$} $html - similarto html    regexp {&lt;span&gt;All \((.*?)\)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;(.*)$} $html - allcount html    if {$similarto eq "" || $allcount eq ""} {      puthelp "PRIVMSG $ch :$asx(logo)Unable to get the requested data."      return 0    }    set re {&lt;td class=\"data-col0[^&gt;]+&gt;[^&gt;]+&gt;(.*?)&lt;/a&gt;&lt;/td&gt;[^&gt;]+&gt;(.*?)&lt;/td&gt;(.*)$}    while {[dict size $simdict] &lt; 5} {      if {![regexp $re $html - ssym sname html]} {   break   }      dict set simdict $ssym $sname    }    set say "$asx(logo)Symbol Lookup &gt;"    if {[set dsize [dict size $simdict]] == 0} {      puthelp "PRIVMSG $ch :$say Found no symbols similar to: \002${sym}\002"      return 0    }    if {$dsize == 1} {  append say " Found one symbol similar to '${sym}':"      puthelp "PRIVMSG $ch :$say  \002${ssym}\002 $sname"      return 0    }    if {$dsize &lt;= 3} {  append say " Found $dsize symbols similar to '${sym}':"    } else {  append say " Found $allcount symbols similar to '${sym}'." }    if {$allcount &gt; 5} {   append say "  Showing the first 5:"    } elseif {$allcount &gt; 3} {   append say "  Showing all of them:"   }    dict for {sy co} $simdict {   append say "  \002${sy}\002 $co"   }    puthelp "PRIVMSG $ch :$say"    return 0  } ;# end: is redirected 302 #  set company ""  ;   set xinfo ""  regexp {&lt;h1 class=\"D\(ib\) Fz\(18px\)\"&gt;(.*?)&lt;/h1&gt;(.*)$} $html - company html  regexp {^&lt;/div&gt;[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $html - xinfo html  if {$company eq "" || $xinfo eq ""} {    puthelp "PRIVMSG $ch :$asx(logo)Invalid Company Symbol:  \002${sym}\002"    return 0  }  set qmap [list %k $nk %h $ch %y $company %x $xinfo]  set ils {lastprice change percent notice prevclose open bid ask dayrange 52weeks}  foreach vname [lappend ils volume avgvolume marketcap] {  set $vname "N/A"  }  regexp {regularMarketPrice[^&gt;]+&gt;(.*?)&lt;/fin-str(.*)$} $html - lastprice html  regexp {regularMarketChange[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $html - change html  regexp {MarketChangePercent[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $html - percent html  regexp {quote-market-notice[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $html - notice html  if {[matchstr "-*" $change]} {    set change "\00304$change\003"  ;  set percent "\00304$percent\003"  } elseif {[matchstr "+*" $change]} {    set change "\00303$change\003"  ;  set percent "\00303$percent\003"  }  lappend qmap %l $lastprice %c $change %p $percent %n $notice  regexp {PREV_CLOSE-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - prevclose html  regexp {\"OPEN-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - open html  regexp {\"BID-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - bid html  regexp {\"ASK-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - ask html  regexp {DAYS_RANGE-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - dayrange html  lappend qmap %r $prevclose %o $open %b $bid %a $ask %d $dayrange  regexp {FIFTY_TWO_WK_RANGE-value\"&gt;(.*?)&lt;/td&gt;(.*)$} $html - 52weeks html  regexp {regularMarketVolume[^&gt;]+&gt;(.*?)&lt;/fin-streamer(.*)$} $html - volume html  regexp {AVERAGE_VOLUME_3MONTH-value\"&gt;(.*?)&lt;/td&gt;(.*)$} $html - avgvolume html  regexp {\"MARKET_CAP-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - marketcap html  lappend qmap %w $52weeks %v $volume %g $avgvolume %m $marketcap  set hmap [list "'" "'" "&amp;" "&amp;" """ "\""]  #### e f i j q s t u z ####  #  %y  = company name      ex.  Apollo Minerals Limited (AON.AX)  #  %x  = asx info  ??      ex.  ASX - ASX Delayed price. Currency in AUD  #  %l  = last price        ex.  108.66  #  %c  = price change      ex.  -0.08  #  %p  = change percent    ex.  (-0.07%)  #  %n  = market notice     ex.  As of  10:17AM AEDT. Market open.  #  %r  = previous close    ex.  108.74  #  %o  = open              ex.  108.74  #  %b  = bid               ex.  108.66 x 36400  #  %a  = ask               ex.  108.69 x 7100  #  %d  = day's range       ex.  108.38 - 109.15  #  %w  = 52-week range     ex.  86.98 - 109.20  #  %v  = volume            ex.  3,747,153  #  %g  = avg. volume       ex.  2,190,023  #  %m  = market cap        ex.  183.463B  #  %k  = nick              ex.  GreedyHamster  #  %h  = channel           ex.  #MarketHub  set say [list "$asx(logo)%y  \002%l AUD\002  Change: \002%c %p\002  %n"]  set s "Previous close: \002%r\002  Open: \002%o\002  Bid: \002%b\002  "  append s "Ask: \002%a\002  Day's range: \002%d\002  Market cap: \002%m\002"  lappend say $s  foreach ln $say {    set ln [string map $qmap $ln]  ;   set ln [string map $hmap $ln]    putserv "PRIVMSG $ch :$ln"  }  return 0}proc onsource {} {   variable asx  set asx(chan) [split [string tolower [string trim $asx(chan)]]]  set asx(companylist_filename) [string trim $asx(companylist_filename)]  set asx(companydict) [dict create]  if {[file exists $asx(companylist_filename)]} {    set open [open $asx(companylist_filename) r]    set asx(companydict) [read -nonewline $open]   ;  close $open  }}onsourceputlog "Loaded ausStocks.tcl version 0.3  10Feb2023"}  ;## end of:  namespace eval ausStocks ##</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Feb 13, 2023 2:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-01-28T23:09:03-04:00</updated>

		<published>2023-01-28T23:09:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111662#p111662</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111662#p111662"/>
		<title type="html"><![CDATA[Re: ausStocks.tcl version 0.2  27Jan2023]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111662#p111662"><![CDATA[
Thanks Spike and LOL @ GreedyHamster <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> love it <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=12911">rainman</a> — Sat Jan 28, 2023 11:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-28T09:16:29-04:00</updated>

		<published>2023-01-28T09:16:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111661#p111661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111661#p111661"/>
		<title type="html"><![CDATA[ausStocks.tcl version 0.2  27Jan2023]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111661#p111661"><![CDATA[
Version 0.2 adds some bare minimum sanity/error checks w/ reporting: <br> 1) restricts user input to 3 - 6 alphanumeric characters. <br> 2) adds some error checking on the http connection &amp; get.<br> 3) put the entire script code in the namespace ausStocks.<br><div class="codebox"><p>Code: </p><pre><code>## ausStocks.tcl version 0.2  27Jan2023 #### Version 0.2 adds some bare minimum sanity checks w/ reporting:# 1) restricts user input to 3 - 6 alphanumeric characters.# 2) adds some error checking on the http connection &amp; get.# 3) put the entire script code in the namespace ausStocks.# public command syntax:  !asx &lt;symbol&gt;# example:  !asx csl##########################################namespace eval ausStocks {package require httppackage require tls::http::register https 443 {::tls::socket -autoservername true}#::http::register https 443 [list ::tls::socket -servername au.finance.yahoo.com]bind pub - !asx [namespace current]::asx:bindpubproc asx:bindpub {nk uh hn ch tx} {  set sym [string toupper [lindex [split [string trim $tx]] 0]]  if {[string length $sym] ni {3 4 5 6} || [regexp {[^0-9A-Z]} $sym]} {    puthelp "PRIVMSG $ch :\00306&lt;ASX&gt;\003 Command syntax:  \002!asx &lt;symbol&gt;\002"    return 0  }  set address "https://au.finance.yahoo.com/quote/${sym}.AX?p=${sym}.AX"  ::http::config -useragent "Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"  #::http::register https 443 {::tls::socket -autoservername true}  #::http::register https 443 [list ::tls::socket -servername au.finance.yahoo.com]  # Thanks thommey #  if {[catch {::http::geturl $address -timeout 7500} tok]} {  error $tok  }  if {[::http::status $tok] ne "ok"} {    error "TCP error: [::http::status $tok][::http::cleanup $tok]"  } elseif {[::http::ncode $tok] != 200} {    error "HTTP error: [::http::code $tok][::http::cleanup $tok]"  }  set html [::http::data $tok]  ;   ::http::cleanup $tok  set html [join [lrange [split $html "\n"] 4 6] {}]  set company ""  ;   set xinfo ""  ;   set lastprice ""  regexp {&lt;h1 class=\"D\(ib\) Fz\(18px\)\"&gt;(.*?)&lt;/h1&gt;(.*)$} $html - company html  regexp {^&lt;/div&gt;[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $html - xinfo html  regexp {regularMarketPrice[^&gt;]+&gt;(.*?)&lt;/fin-str(.*)$} $html - lastprice html  if {$company eq "" || $xinfo eq "" || $lastprice eq ""} {    puthelp "PRIVMSG $ch :\00306&lt;ASX&gt;\003 Invalid Company Symbol:  \002$sym\002"    return 0  }  set qmap [list %k $nk %h $ch %y $company %x $xinfo %l $lastprice]  set ils {change percent notice prevclose open bid ask dayrange}  foreach vname [lappend ils 52weeks volume avgvolume marketcap] {    set $vname "N/A"  }  regexp {regularMarketChange[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $html - change html  regexp {MarketChangePercent[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $html - percent html  regexp {quote-market-notice[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $html - notice html  if {[matchstr "-*" $change]} {    set change "\00304$change\003"  ;  set percent "\00304$percent\003"  } elseif {[matchstr "+*" $change]} {    set change "\00303$change\003"  ;  set percent "\00303$percent\003"  }  lappend qmap %c $change %p $percent %n $notice  regexp {PREV_CLOSE-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - prevclose html  regexp {\"OPEN-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - open html  regexp {\"BID-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - bid html  regexp {\"ASK-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - ask html  regexp {DAYS_RANGE-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - dayrange html  lappend qmap %r $prevclose %o $open %b $bid %a $ask %d $dayrange  regexp {FIFTY_TWO_WK_RANGE-value\"&gt;(.*?)&lt;/td&gt;(.*)$} $html - 52weeks html  regexp {regularMarketVolume[^&gt;]+&gt;(.*?)&lt;/fin-streamer(.*)$} $html - volume html  regexp {AVERAGE_VOLUME_3MONTH-value\"&gt;(.*?)&lt;/td&gt;(.*)$} $html - avgvolume html  regexp {\"MARKET_CAP-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - marketcap html  lappend qmap %w $52weeks %v $volume %g $avgvolume %m $marketcap  set hmap [list "'" "'" "&amp;" "&amp;" """ "\""]  #### e f i j q s t u z ####  #  %y  = company name      ex.  Apollo Minerals Limited (AON.AX)  #  %x  = asx info  ??      ex.  ASX - ASX Delayed price. Currency in AUD  #  %l  = last price        ex.  108.66  #  %c  = price change      ex.  -0.08  #  %p  = change percent    ex.  (-0.07%)  #  %n  = market notice     ex.  As of  10:17AM AEDT. Market open.  #  %r  = previous close    ex.  108.74  #  %o  = open              ex.  108.74  #  %b  = bid               ex.  108.66 x 36400  #  %a  = ask               ex.  108.69 x 7100  #  %d  = day's range       ex.  108.38 - 109.15  #  %w  = 52-week range     ex.  86.98 - 109.20  #  %v  = volume            ex.  3,747,153  #  %g  = avg. volume       ex.  2,190,023  #  %m  = market cap        ex.  183.463B  #  %k  = nick              ex.  GreedyHamster  #  %h  = channel           ex.  #MarketHub  set say [list "\00306&lt;ASX&gt;\003 %y  \002%l AUD\002  Change: \002%c %p\002  %n"]  set s "Previous close: \002%r\002  Open: \002%o\002  Bid: \002%b\002  "  append s "Ask: \002%a\002  Day's range: \002%d\002  Market cap: \002%m\002"  lappend say $s  foreach ln $say {    set ln [string map $qmap $ln]  ;   set ln [string map $hmap $ln]    putserv "PRIVMSG $ch :$ln"  }  return 0}putlog "Loaded ausStocks.tcl version 0.2  27Jan2023"}  ;## end of:  namespace eval ausStocks ##</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Jan 28, 2023 9:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-01-25T20:14:11-04:00</updated>

		<published>2023-01-25T20:14:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111658#p111658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111658#p111658"/>
		<title type="html"><![CDATA[Re: ausStocks.tcl version 0.1  24Jan2023]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111658#p111658"><![CDATA[
Thank you so much spike, you are the man sir <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>i'll def give it a better whirl tomorrow when markets open up xD<br><br>So far it's working as expected <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=12911">rainman</a> — Wed Jan 25, 2023 8:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-25T19:46:57-04:00</updated>

		<published>2023-01-25T19:46:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111657#p111657</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111657#p111657"/>
		<title type="html"><![CDATA[stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111657#p111657"><![CDATA[
thommey said put it there, and stop using ::http::unregister https:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Jan 25, 2023 7:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-01-25T19:07:24-04:00</updated>

		<published>2023-01-25T19:07:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111656#p111656</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111656#p111656"/>
		<title type="html"><![CDATA[stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111656#p111656"><![CDATA[
short advice: don't register globaly https but register it when needed (before query) and unregister when cleaning the connection.<br>If another script globaly unregister https, yours will not work anymore.<br><br>Keep in mind that your script is not the only one running on the eggdrop.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Jan 25, 2023 7:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-25T18:32:40-04:00</updated>

		<published>2023-01-25T18:32:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111655#p111655</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111655#p111655"/>
		<title type="html"><![CDATA[ausStocks.tcl version 0.1  24Jan2023]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111655#p111655"><![CDATA[
Tested some, give it a shot:)<br><div class="codebox"><p>Code: </p><pre><code>## ausStocks.tcl version 0.1  24Jan2023 ### public command syntax:  !asx &lt;symbol&gt;# example:  !asx cslpackage require httppackage require tlshttp::register https 443 {tls::socket -autoservername true}bind pub - !asx asx:bindpubproc asx:bindpub {nk uh hn ch tx} {  set symbol [string toupper [lindex [split [string trim $tx]] 0]]  if {[string length $symbol] &lt; 3 || [string length $symbol] &gt; 6} { return 0 }  set address "https://au.finance.yahoo.com/quote/${symbol}.AX?p=${symbol}.AX"  set token [::http::geturl $address -timeout 7500]  set html [::http::data $token]  ;   ::http::cleanup $token  set html [join [lrange [split $html "\n"] 4 6] {}]  set ils {company xinfo lastprice change percent notice prevclose open bid ask}  foreach vname [lappend ils dayrange 52weeks volume avgvolume marketcap] {    set $vname "N/A"  }  set qmap [list %k $nk %h $ch]  regexp {&lt;h1 class=\"D\(ib\) Fz\(18px\)\"&gt;(.*?)&lt;/h1&gt;(.*)$} $html - company html  regexp {^&lt;/div&gt;[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $html - xinfo html  regexp {regularMarketPrice[^&gt;]+&gt;(.*?)&lt;/fin-str(.*)$} $html - lastprice html  regexp {regularMarketChange[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $html - change html  regexp {MarketChangePercent[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $html - percent html  regexp {quote-market-notice[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $html - notice html  if {[matchstr "-*" $change]} {    set change "\00304$change\003"  ;  set percent "\00304$percent\003"  } elseif {[matchstr "+*" $change]} {    set change "\00303$change\003"  ;  set percent "\00303$percent\003"  }  lappend qmap %y $company %x $xinfo %l $lastprice %c $change %p $percent  regexp {PREV_CLOSE-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - prevclose html  regexp {\"OPEN-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - open html  regexp {\"BID-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - bid html  regexp {\"ASK-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - ask html  lappend qmap %n $notice %r $prevclose %o $open %b $bid %a $ask  regexp {DAYS_RANGE-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - dayrange html  regexp {FIFTY_TWO_WK_RANGE-value\"&gt;(.*?)&lt;/td&gt;(.*)$} $html - 52weeks html  regexp {regularMarketVolume[^&gt;]+&gt;(.*?)&lt;/fin-streamer(.*)$} $html - volume html  regexp {AVERAGE_VOLUME_3MONTH-value\"&gt;(.*?)&lt;/td&gt;(.*)$} $html - avgvolume html  regexp {\"MARKET_CAP-value\"&gt;(.*?)&lt;/td&gt;&lt;/tr&gt;(.*)$} $html - marketcap html  lappend qmap %d $dayrange %w $52weeks %v $volume %g $avgvolume %m $marketcap  set hmap [list "'" "'" "&amp;" "&amp;" """ "\""]  #### e f i j q s t u z ####  #  %y  = company name      ex.  Apollo Minerals Limited (AON.AX)  #  %x  = asx info  ??      ex.  ASX - ASX Delayed price. Currency in AUD  #  %l  = last price        ex.  108.66  #  %c  = price change      ex.  -0.08  #  %p  = change percent    ex.  (-0.07%)  #  %n  = market notice     ex.  As of  10:17AM AEDT. Market open.  #  %r  = previous close    ex.  108.74  #  %o  = open              ex.  108.74  #  %b  = bid               ex.  108.66 x 36400  #  %a  = ask               ex.  108.69 x 7100  #  %d  = day's range       ex.  108.38 - 109.15  #  %w  = 52-week range     ex.  86.98 - 109.20  #  %v  = volume            ex.  3,747,153  #  %g  = avg. volume       ex.  2,190,023  #  %m  = market cap        ex.  183.463B  #  %k  = nick              ex.  SpiKe^^  #  %h  = channel           ex.  #pc-mirc-help  set say [list "\00306&lt;ASX&gt;\003 %y  \002%l AUD\002  Change: \002%c %p\002  %n"]  set s "Previous close: \002%r\002  Open: \002%o\002  Bid: \002%b\002  "  append s "Ask: \002%a\002  Day's range: \002%d\002  Market cap: \002%m\002"  lappend say $s  foreach ln $say {    set ln [string map $qmap $ln]  ;   set ln [string map $hmap $ln]    puthelp "PRIVMSG $ch :$ln"  }  return 0}putlog "Loaded ausStocks.tcl version 0.1  24Jan2023"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Jan 25, 2023 6:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-01-22T03:10:34-04:00</updated>

		<published>2023-01-22T03:10:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111654#p111654</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111654#p111654"/>
		<title type="html"><![CDATA[Re: maybe au.finance.yahoo.com/quote/]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111654#p111654"><![CDATA[
<blockquote class="uncited"><div>Looks to me like the source code from here is user friendly:)<br><a href="https://au.finance.yahoo.com/quote/CBA.AX?p=CBA.AX" class="postlink">https://au.finance.yahoo.com/quote/CBA.AX?p=CBA.AX</a><br><br>With that being all the data available,  what fields would you include in the channel post?</div></blockquote>Market Cap:<br>Open:<br>Prev Close:<br>Bid:<br>Ask:<br>Day's Range: <br><br>Just those please spike <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=12911">rainman</a> — Sun Jan 22, 2023 3:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-22T02:49:42-04:00</updated>

		<published>2023-01-22T02:49:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111653#p111653</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111653#p111653"/>
		<title type="html"><![CDATA[maybe au.finance.yahoo.com/quote/]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111653#p111653"><![CDATA[
Looks to me like the source code from here is user friendly:)<br><a href="https://au.finance.yahoo.com/quote/CBA.AX?p=CBA.AX" class="postlink">https://au.finance.yahoo.com/quote/CBA.AX?p=CBA.AX</a><br><br>With that being all the data available,  what fields would you include in the channel post?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Jan 22, 2023 2:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-01-22T00:44:07-04:00</updated>

		<published>2023-01-22T00:44:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111652#p111652</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111652#p111652"/>
		<title type="html"><![CDATA[stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111652#p111652"><![CDATA[
<blockquote class="uncited"><div>Looking over the html source file much closer, shows they hide their quote data very well.<blockquote class="uncited"><div>&lt;td&gt;Last (Price)&lt;/td&gt;<br>&lt;td class="text-right"&gt;<br>&lt;span data-quoteapi="price"&gt;&lt;/span&gt;<br>&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt;<br>&lt;td&gt;Change&lt;/td&gt;<br>&lt;td class="text-right" data-quoteapi="changeSignCSS"&gt;<br>&lt;span data-quoteapi="change showNegativeSign=false"&gt;0.00&lt;/span&gt;<br>(&lt;span data-quoteapi="pctChange showNegativeSign=true"&gt;0.00&lt;/span&gt;)<br>&lt;/td&gt;<br>&lt;/tr&gt;</div></blockquote>The headers are there but none of the data.<br>I do not know how to get any quote data from this site.<br><br>Maybe you know a usable source site for this stock quote data, or a way to force any data from this site?</div></blockquote>Hello Spike, <br><br>How about directly from the source <br><br><a href="https://www2.asx.com.au/markets/company/cba" class="postlink">https://www2.asx.com.au/markets/company/cba</a> <br><br>Is that more usable ? <br><br><a href="https://www2.asx.com.au/" class="postlink">https://www2.asx.com.au/</a><br><br>If that's a bust only other one i found would be<br><br><a href="https://au.finance.yahoo.com/" class="postlink">https://au.finance.yahoo.com/</a><br><br><a href="https://au.finance.yahoo.com/quote/CBA.AX?p=CBA.AX&amp;.tsrc=fin-srch" class="postlink">https://au.finance.yahoo.com/quote/CBA. ... c=fin-srch</a><br><br>I really do appreciate your efforts into this, thank you so much<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12911">rainman</a> — Sun Jan 22, 2023 12:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-22T00:12:15-04:00</updated>

		<published>2023-01-22T00:12:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111651#p111651</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111651#p111651"/>
		<title type="html"><![CDATA[stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111651#p111651"><![CDATA[
Looking over the html source file much closer, shows they hide their quote data very well.<blockquote class="uncited"><div>&lt;td&gt;Last (Price)&lt;/td&gt;<br>&lt;td class="text-right"&gt;<br>&lt;span data-quoteapi="price"&gt;&lt;/span&gt;<br>&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt;<br>&lt;td&gt;Change&lt;/td&gt;<br>&lt;td class="text-right" data-quoteapi="changeSignCSS"&gt;<br>&lt;span data-quoteapi="change showNegativeSign=false"&gt;0.00&lt;/span&gt;<br>(&lt;span data-quoteapi="pctChange showNegativeSign=true"&gt;0.00&lt;/span&gt;)<br>&lt;/td&gt;<br>&lt;/tr&gt;</div></blockquote>The headers are there but none of the data.<br>I do not know how to get any quote data from this site.<br><br>Maybe you know a usable source site for this stock quote data, or a way to force any data from this site?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Jan 22, 2023 12:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rainman]]></name></author>
		<updated>2023-01-13T09:54:30-04:00</updated>

		<published>2023-01-13T09:54:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111621#p111621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111621#p111621"/>
		<title type="html"><![CDATA[stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111621#p111621"><![CDATA[
<blockquote class="uncited"><div>There is a pile of info in the "Snapshot", way too much to present in a channel post.<br><br>Maybe pick a few key entries to present?<br>Better yet, type out an example of what a channel post would look like:)</div></blockquote>Oh right sorry <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>How about just the following<br><br>Open Price: <br>Last Price: <br>Bid / Ask: <br>Day Range: <br>Prev Close: <br>Last Trade:<br>Market Cap: <br>Change: <br><br>Is that more reasonable <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=12911">rainman</a> — Fri Jan 13, 2023 9:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-01-13T09:26:33-04:00</updated>

		<published>2023-01-13T09:26:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111620#p111620</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111620#p111620"/>
		<title type="html"><![CDATA[stock exchange script for Australia]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111620#p111620"><![CDATA[
There is a pile of info in the "Snapshot", way too much to present in a channel post.<br><br>Maybe pick a few key entries to present?<br>Better yet, type out an example of what a channel post would look like:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Jan 13, 2023 9:26 am</p><hr />
]]></content>
	</entry>
	</feed>
