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

	<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>2024-03-07T16:17:38-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Dominatez]]></name></author>
		<updated>2024-03-07T16:17:38-04:00</updated>

		<published>2024-03-07T16:17:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112616#p112616</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112616#p112616"/>
		<title type="html"><![CDATA[Re: yhoo.tcl finance script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112616#p112616"><![CDATA[
It is a shame that this no longer works.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12783">Dominatez</a> — Thu Mar 07, 2024 4:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[vam2u]]></name></author>
		<updated>2023-04-25T01:21:44-04:00</updated>

		<published>2023-04-25T01:21:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111872#p111872</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111872#p111872"/>
		<title type="html"><![CDATA[yhoo.tcl finance script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111872#p111872"><![CDATA[
Cool, let me add those in and see how thing's goes <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=12907">vam2u</a> — Tue Apr 25, 2023 1:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-04-24T11:25:02-04:00</updated>

		<published>2023-04-24T11:25:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111867#p111867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111867#p111867"/>
		<title type="html"><![CDATA[yhoo.tcl finance script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111867#p111867"><![CDATA[
Each line can have any number of alternate triggers.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Apr 24, 2023 11:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2023-04-24T11:19:34-04:00</updated>

		<published>2023-04-24T11:19:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111866#p111866</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111866#p111866"/>
		<title type="html"><![CDATA[yhoo.tcl finance script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111866#p111866"><![CDATA[
Is it not :<div class="codebox"><p>Code: </p><pre><code>litecoin ltc lite LTC-USD</code></pre></div>most of your entries has 4 elements<br><br>(didn't read the full code, so I'm probably wrong)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Apr 24, 2023 11:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-04-24T10:27:22-04:00</updated>

		<published>2023-04-24T10:27:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111865#p111865</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111865#p111865"/>
		<title type="html"><![CDATA[yhoo custom commands]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111865#p111865"><![CDATA[
You can add any number of custom commands in the script setting...<div class="codebox"><p>Code: </p><pre><code># set public Custom Command Triggers:   () #set yh(cust_cmds) {gold au go GC=Fsilver ag si sil silv SI=Fcrude cr cru crud crudeoil CL=Feur eurusd eur/usd EURUSD=Xgbp gbpusd gbp/usd GBPUSD=Xusdjpy usd/jpy JPY=Xbitcoin btc btcusd BTC-USDethereum eth ethusd ETH-USDdogecoin doge dog dogeusd DOGE-USDs&amp;p500 s&amp;p snp500 snp ^GSPCdow dow30 dowjones ^DJI} ;# End of: set yh(cust_cmds) #</code></pre></div>Each line in that setting represents one custom command:<br>The last word in each line must be a valid yahoo finance  symbol,<br>All the other words become valid custom commands for that symbol.<br><br>Lets say you want a new custom command for Litecoin:<br>Add a new line to the yh(cust_cmds) setting, to be something like<div class="codebox"><p>Code: </p><pre><code>ltc lite LTC-USD</code></pre></div>and that will add 3 new commands all pointing to LTC-USD:<br>You can now use:<br>.lite<br>!ltc<br>.ltc-usd<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Mon Apr 24, 2023 10:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[vam2u]]></name></author>
		<updated>2023-04-24T09:38:42-04:00</updated>

		<published>2023-04-24T09:38:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111864#p111864</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111864#p111864"/>
		<title type="html"><![CDATA[yhoo.tcl finance script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111864#p111864"><![CDATA[
Tested the script, it's cool <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"><br>How do I add more currency and cryptos prefix to it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12907">vam2u</a> — Mon Apr 24, 2023 9:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2023-04-11T19:54:38-04:00</updated>

		<published>2023-04-11T19:54:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111827#p111827</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111827#p111827"/>
		<title type="html"><![CDATA[yhoo.tcl finance script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111827#p111827"><![CDATA[
If you know the financial symbol, you can get the current quote info from finance.yahoo.com<br><br>Please suggest what else this script needs:)<br><div class="codebox"><p>Code: </p><pre><code>###########  yhoo.tcl  ver. 0.1  by SpiKe^^  ########## 08Apr2023 ############### public yhoo.tcl command ##### command syntax:  !yh &lt;symbol&gt;# example:  !yh csl#           .q gm######################################################namespace eval yhoo {   variable yhpackage require Tcl 8.5package require httppackage require tlssetudef flag yhoo   ;# &lt;= Use  .chanset #chan +yhoo  to enable this script by channel.################### begin settings #################### set active channel(s) for this script  (or set empty to only use .chanset #ch +yhoo)#  or use:  set yh(chan) "*"  to make the script active in all bot channels.# note:  the channels set here can not be disabled by using  .chanset #ch -yhooset yh(chan) "*"# Command Char(s) to use for public binds# Examples:  "!" or "."# Or a Space Separated List: "! . ?"set yh(cmdchars) "! ."# set public Stock/Futures/Crypto Quote Command(s): ## This command shows current price &amp; change, plus recent stats. #set yh(cmds_q) "q quote yh"# set public Custom Command Triggers:   () #set yh(cust_cmds) {gold au go GC=Fsilver ag si sil silv SI=Fcrude cr cru crud crudeoil CL=Feur eurusd eur/usd EURUSD=Xgbp gbpusd gbp/usd GBPUSD=Xusdjpy usd/jpy JPY=Xbitcoin btc btcusd BTC-USDethereum eth ethusd ETH-USDdogecoin doge dog dogeusd DOGE-USDs&amp;p500 s&amp;p snp500 snp ^GSPCdow dow30 dowjones ^DJI} ;# End of: set yh(cust_cmds) ## script logo  (placed before almost every line sent to the channel)set yh(logo) "\00306\[yhoo\]\003 "############ end settings ############ end settings #########################################################################################################::http::register https 443 {::tls::socket -autoservername true}##############proc bindpubm {nk uh hn ch tx} {   variable yh  set c [slower $ch]  if {![channel get $ch yhoo] &amp;&amp; ("*" ni $yh(chan)) &amp;&amp; ($c ni $yh(chan))} {    return 0  }  set tls [lassign [split [set tx [strim $tx]]] cmd arg1]  set cm [string range $cmd 1 end]  if {[set x [lsearch -nocase -inline $yh(cust_cmds) "* $cm *"]] ne ""} {    set custln [split [string trim $x]]    set arg1 [lindex $custln end]    set cm [lindex $yh(cmds_q) 0]   ;   set cmd "[string index $cmd 0]${cm}"  }  set allcmds [concat $yh(cmds_q) $yh(cmds_fq)]  if {[lsearch -nocase $allcmds $cm] == -1} {  return 0  }  set sym [supper $arg1]  if {$arg1 eq "" || [string length $arg1]&gt;10 || [regexp {[^0-9A-Z^.=-]} $sym]} {    set say "$yh(logo)Command syntax: \002$cmd &lt;symbol&gt;\002"    puthelp "PRIVMSG $ch :$say  example: \002$cmd csl\002"    return 0  }  if {[matchstr "*=F" $sym]} {        set doing "f"  } elseif {[matchstr "^*" $sym]} {   set doing "i"  } elseif {[matchstr "*=X" $sym]} {  set doing "x"  } else {   set doing ""   }  set fq [::http::formatQuery p $sym]  set pr "https://"  ;  set la ""  ;  set ar "finance."  ;  set do "yahoo.com"  set addr "${pr}${la}${ar}${do}"  ;#https://finance.yahoo.com ;#https://au.finance.yahoo.com  set address "${addr}/quote/[lindex [split $fq =] 1]?${fq}"#######################################  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 "$yh(logo) [string range $err 2 end]"    if {[string index $err 0] &gt; 1} {   ::http::cleanup $tok   }    puthelp "PRIVMSG $ch :$yh(logo)Unable to get the requested data. Try again later."    return 0  }##########################################  set html [::http::data $tok]  ;   ::http::cleanup $tok  #set open [open scripts/yhoo.html.txt w]; puts $open $html; close $open  #putlog "wrote file: scripts/yhoo.html.txt"  set html [split $html "\n"]  if {$try == 1 &amp;&amp; $doing eq ""} {    if {[matchstr "*cryptocurrency*" [lindex $html 0]]} {  set doing "c"  }  }  set html [lrange $html 4 36]  if {$try == 2} {   set similarto ""  ;   set allcount ""  ;   set simdict {}    set html [join $html {}]    if {[regexp {\"lookup-page\"(.*?)&lt;/tbody&gt;&lt;/table&gt;} $html - html]} {      regexp {&lt;h2 [^&lt;]+&lt;span&gt;(.*?)&lt;/span&gt;&lt;/h2&gt;(.*)$} $html - similarto html      regexp {\"/lookup/all[^&lt;]+&lt;span&gt;(.*?)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;(.*)$} $html - allcount html      set similarto [lindex [split $similarto] end]      set allcount [lindex [split $allcount "()"] 1]      if {$similarto eq "" || $allcount eq ""} {        puthelp "PRIVMSG $ch :$yh(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 "$yh(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"    } else {  puthelp "PRIVMSG $ch :$yh(logo)Unable to get the similar symbol list."      putlog "$yh(logo) Html source error: Unable to find the similar symbol list."    }    return 0  }##########################################  set company ""  ;   set xinfo ""  ;   set sp {            }  set fnd 0  foreach hline $html {    if {![matchstr "$sp&lt;*" $hline] &amp;&amp; ![matchstr "$sp    \;*" $hline]} { continue }    set hline [string trimleft $hline]    if {$fnd == 0 &amp;&amp; [matchstr "[string repeat &lt;/div&gt; 7]&lt;div *" $hline]} {      regexp {&lt;h1 class=\"D\(ib\) Fz\(18px\)\"&gt;(.*?)&lt;/h1&gt;(.*)$} $hline - company hline      regexp {^&lt;/div&gt;[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $hline - xinfo hline      if {$company eq "" || $xinfo eq ""} {        puthelp "PRIVMSG $ch :$yh(logo)Invalid Company Symbol:  \002${sym}\002"        return 0      }      set qmap [list %nk $nk %ch $ch %co $company %xi $xinfo]   ;   set fnd 1      set ils {lastprice change percent notice prevclose prevc_txt open open_txt bid bid_txt}      lappend ils ask ask_txt dayrange dayra_txt 52weeks 52wee_txt volume volum_txt      lappend ils avgvolume avgvo_txt marketcap marke_txt 5year 5year_txt peratio perat_txt      lappend ils epsratio epsra_txt      # crypto only #      lappend ils startdate start_txt algorithm algor_txt cirsupply cirsu_txt      lappend ils maxsupply maxsu_txt vol24hr vol24_txt volall volal_txt      # futures only #      lappend ils prevsett prevs_txt datesett dates_txt lprice lpric_txt      # ETF (exchange-traded funds) only #      lappend ils netassets netas_txt nav nav_txt yield yield_txt      foreach vname $ils {  set $vname ""  }      regexp {regularMarketPrice[^&gt;]+&gt;(.*?)&lt;/fin-str(.*)$} $hline - lastprice hline      regexp {regularMarketChange[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $hline - change hline      regexp {rMarketChangePercent[^&gt;]+&gt;&lt;[^&gt;]+&gt;(.*?)&lt;/span(.*)$} $hline - percent hline      regexp {quote-market-notice[^&gt;]+&gt;&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $hline - notice hline      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"      } else {  set change "\00312$change\003"  ;  set percent "\00312$percent\003"  }      set notice [string map [list "  " " "] $notice]      lappend qmap %la $lastprice %lc $change %lp $percent %ln $notice      foreach vname {postprice preprice pchange ppercent pn_txt pn_time pnotice} {        set $vname ""      }      set re {MarketPrice[^&gt;]+&gt;(.*?)&lt;/fin-streame(.*)$}      if {[regexp pre$re $hline - preprice hline]} {        set tm preMarket   ;   lappend pmap %pm $preprice      } elseif {[regexp post$re $hline - postprice hline]} {        set tm postMarket  ;   lappend pmap %pm $postprice      }      if {[info exists pmap]} {        regexp "${tm}Change\"\[^&lt;\]+&lt;\[^&gt;\]+&gt;(.*?)&lt;/span&gt;(.*)\$" $hline - pchange hline        regexp "${tm}ChangePercent\[^&lt;\]+&lt;\[^&gt;\]+&gt;(.*?)&lt;/span&gt;(.*)\$" $hline - ppercent hline        regexp {^&lt;/fi[^&lt;]+&lt;/span&gt;&lt;br/&gt;&lt;[^&lt;]+&lt;span&gt;(.*?)&lt;/span&gt;(.*)$} $hline - pn_txt hline        regexp "${tm}Time\"\[^&gt;\]+&gt;(.*?)&lt;/fin-streamer&gt;(.*)\$" $hline - pn_time hline        if {[matchstr "-*" $pchange]} {         set p1 "\00304"  ;  set pe "\003"          set pchange "\00304$pchange\003"   ;  set ppercent "\00304$ppercent\003"        } elseif {[matchstr "+*" $pchange]} {   set p1 "\00303"  ;  set pe "\003"          set pchange "\00303$pchange\003"   ;  set ppercent "\00303$ppercent\003"        } else {                                set p1 "\00312"  ;  set pe "\003"          set pchange "\00312$pchange\003"   ;  set ppercent "\00312$ppercent\003"  }        set pnotice "$pn_txt $pn_time"        lappend pmap %pc $pchange %pp $ppercent %px $pn_txt %pt $pn_time %pn $pnotice        lappend pmap %p1 $p1 %pe $pe      }    } elseif {$fnd == 1 &amp;&amp; [matchstr ";&lt;/script&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;scr*" $hline]} {      set re {summary-table\"&gt;&lt;table[^&lt;]+&lt;tbody&gt;(.*?)&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;(.*)$}      if {[regexp left-$re $hline - rs hline]}  {  append rows $rs  }      if {[regexp right-$re $hline - rs hline]} {  append rows $rs  }      if {[info exists rows]} {    set cnt 0        while {[regexp {^&lt;tr (.*?)&gt;&lt;/tr&gt;(.*)$} $rows - rw rows]} {   incr cnt          if {[regexp {&lt;span&gt;(.*?)&lt;/span&gt;&lt;/td&gt;&lt;td.*?data-test=(.*)&lt;/td$} $rw - lang val]} {            set val [join [lassign [split $val "&gt;"] name] "&gt;"]            set name [string trim $name "\""]            if {[matchstr "&lt;fin-str*" $val]} {              regexp {^&lt;[^&gt;]+&gt;(.*)&lt;/fin-streamer&gt;$} $val - val            } elseif {[matchstr "&lt;span&gt;*" $val]} {              set val [string map [list &lt;/span&gt; "" &lt;span&gt; ""] $val]            }            set got 0            #### crypto only ####            if {$doing eq "c"} {              switch $name {                "START_DATE-value"     {  lappend qmap %sd $val %sx $lang                  set startdate $val   ;  set start_txt $lang  ;  set got 1  }                "ALGORITHM-value"      {  lappend qmap %al $val %ax $lang                  set algorithm $val   ;  set algor_txt $lang  ;  set got 2  }                "CIRCULATING_SUPPLY-value"  {  lappend qmap %is $val %ix $lang                  set cirsupply $val   ;  set cirsu_txt $lang  ;  set got 3  }                "MAX_SUPPLY-value"     {  lappend qmap %xs $val %xx $lang                  set maxsupply $val   ;  set maxsu_txt $lang  ;  set got 4  }                "TD_VOLUME_24HR-value" {  lappend qmap %td $val %tx $lang                  set vol24hr $val     ;  set vol24_txt $lang  ;  set got 5  }                "TD_VOLUME_24HR_ALLCURRENCY-value" { lappend qmap %rr $val %rx $lang                  set volall $val      ;  set volal_txt $lang  ;  set got 6  }              }              if {$cnt &gt;= 12 &amp;&amp; $got &gt; 0} {   break   }            #### futures only ####            } elseif {$doing eq "f"} {              switch $name {                "PREV_SETTLEMENT_DATE-value"  {  lappend qmap %rs $val %rx $lang                  set prevsett $val    ;  set prevs_txt $lang  ;  set got 1  }                "SETTLEMENT_DATE-value" { lappend qmap %sd $val %sx $lang                  set datesett $val    ;  set dates_txt $lang  ;  set got 2  }                "LAST_PRICE-value"     {  lappend qmap %tp $val %tx $lang                  set lprice $val      ;  set lpric_txt $lang  ;  set got 3  }              }              if {$cnt &gt;= 8 &amp;&amp; $got &gt; 0} {   break   }            #### ETF (exchange-traded funds) only ####            } elseif {$doing eq "e"} {              switch $name {                "NAV-value"            {  lappend qmap %na $val %nx $lang                  set nav $val         ;  set nav_txt $lang    ;  set got 1  }                "TD_YIELD-value"       {  lappend qmap %yd $val %yx $lang                  set yield $val       ;  set yield_txt $lang  ;  set got 2  }              }              if {$cnt &gt;= 12 &amp;&amp; $got &gt; 0} {   break   }            }            if {$got &gt; 0} {   continue   }            switch $name {              "PREV_CLOSE-value"     {  lappend qmap %cl $val %cx $lang                set prevclose $val   ;  set prevc_txt $lang   }              "OPEN-value"           {  lappend qmap %op $val %ox $lang                set open $val        ;  set open_txt $lang   }              "BID-value"            {  lappend qmap %bi $val %bx $lang                set bid $val         ;  set bid_txt $lang   }              "ASK-value"            {  lappend qmap %as $val %ax $lang                set ask $val         ;  set ask_txt $lang   }              "DAYS_RANGE-value"     {  lappend qmap %dr $val %dx $lang                set dayrange $val    ;  set dayra_txt $lang   }              "FIFTY_TWO_WK_RANGE-value"  {  lappend qmap %wr $val %wx $lang                set 52weeks $val     ;  set 52wee_txt $lang   }              "TD_VOLUME-value"      {  lappend qmap %vo $val %vx $lang                set volume $val      ;  set volum_txt $lang   }              "AVERAGE_VOLUME_3MONTH-value"  {  lappend qmap %gv $val %gx $lang                set avgvolume $val   ;  set avgvo_txt $lang   }              "MARKET_CAP-value"     {  lappend qmap %mc $val %mx $lang                set marketcap $val   ;  set marke_txt $lang                if {$doing eq ""} {  set doing s  }              }              "NET_ASSETS-value"     {  lappend qmap %ss $val %sx $lang                set netassets $val   ;  set netas_txt $lang                if {$doing eq ""} {  set doing e  }              }              "BETA_5Y-value"        {  lappend qmap %5y $val %5x $lang                set 5year $val       ;  set 5year_txt $lang   }              "PE_RATIO-value"       {  lappend qmap %ra $val %rx $lang                set peratio $val     ;  set perat_txt $lang   }              "EPS_RATIO-value"      {  lappend qmap %er $val %ex $lang                set epsratio $val    ;  set epsra_txt $lang   }            }          }          if {$cnt &gt;= 12} {  break  }        }      }      set fnd 2   ;   break    }  }#################################################################  set hmap [list "'" "'" "'" "'" "&amp;" "&amp;" """ "\""]  ##########  data substitution codes  ##########  ###############################################  #  %nk  = nick              ex.  GreedyHamster  #  %ch  = channel           ex.  #MarketHub  #  %co  = company name      ex.  Apollo Minerals Limited (AON.AX)  #  %xi  = exchange info     ex.  ASX - ASX Delayed price. Currency in AUD  #  %la  = last price        ex.  108.66  #  %lc  = price change      ex.  -0.08  #  %lp  = change percent    ex.  (-0.07%)  #  %ln  = market notice     ex.  As of 10:17AM AEDT. Market open.  #  %pm  = post/pre market   ex.  108.62          (these 6 exist if is post or pre)  #  %pc  = post/pre change   ex.  -0.04  #  %pp  = post/pre percent  ex.  (-0.03%)  #  %pn  = post/pre notice   ex.  After hours: 07:59PM EST  #  %px  = post/pre text     ex.  After hours:   |OR|  Pre-Market:  #  %pt  = post/pre time     ex.  07:59PM EST  #  %p1  = change color      ex.  \00304  #  %pe  = end color         ex.  \003  #  %cl  = previous close    ex.  108.74  #                    %cx    ex.  Previous Close  #  %op  = open              ex.  108.74  #                    %ox    ex.  Open  #  %bi  = bid               ex.  108.66 x 36400  #                    %bx    ex.  Bid  #  %as  = ask               ex.  108.69 x 7100  #                    %ax    ex.  Ask  #  %dr  = day's range       ex.  108.38 - 109.15  #                    %dx    ex.  Day's Range  #  %wr  = 52-week range     ex.  86.98 - 109.20  #                    %wx    ex.  52 Week Range  #  %vo  = volume            ex.  3,747,153  #                    %vx    ex.  Volume  #  %gv  = avg. volume       ex.  2,190,023  #                    %gx    ex.  Avg. Volume  #  %mc  = market cap        ex.  183.463B  #                    %mx    ex.  Market Cap  #  %5y  = 5y monthly        ex.  2.36  #                    %5x    ex.  Beta (5Y Monthly)  #  %ra  = pe ratio          ex.  5.48  #                    %rx    ex.  PE Ratio (TTM)  #  %er  = eps ratio         ex.  8.36  #                    %ex    ex.  EPS (TTM)  #### crypto only ####  #  %sd  = start date        ex.  2010-07-13  #                    %sx    ex.  Start Date  #  %al  = algorithm         ex.  N/A  #                    %ax    ex.  Algorithm  #  %is  = circ. supply      ex.  19.34M  #                    %ix    ex.  Circulating Supply  #  %xs  = max supply        ex.  N/A  #                    %xx    ex.  Max Supply  #  %td  = today volume      ex.  16.23B  #                    %tx    ex.  Volume (24hr)  #  %rr  = vol. all curr.    ex.  16.23B  #                    %rx    ex.  Volume (24hr) All Currencies  #### futures only ####  #  %rs  = prev settlement   ex.  N/A  #                    %rx    ex.  Pre. Settlement  #  %sd  = settlement date   ex.  2023-05-26  #                    %sx    ex.  Settlement Date  #  %tp  = last price        ex.  25.09  #                    %tx    ex.  Last Price  ################################################################################################################  set s "$yh(logo)%co  %xi.  \002%la %lc %lp\002 %ln"  if {[info exists pmap]} {   set tm "  %p1\002\[\[\002%pe%px "    append s [string map $pmap "$tm\002%pm %pc %pp\002 At: %pt%p1\002\]\]\002%pe"]  }  lappend say $s  if {$doing eq "c"} {  ;## crypto (second line) ##    set s "%cx: \002%cl\002  %ox: \002%op\002  %dx: \002%dr\002  "    append s "%wx: \002%wr\002  %mx: \002%mc\002  %vx: \002%vo\002"  } elseif {$doing eq "f"} {  ;## future (second line) ##    set s "%tx: \002%tp\002  %sx: \002%sd\002  %ox: \002%op\002  %bx: \002%bi\002"    append s "  %ax: \002%as\002  %dx: \002%dr\002  %vx: \002%vo\002"  } elseif {$doing eq "i"} {  ;## index (second line) ##    set s "%cx: \002%cl\002  %ox: \002%op\002  %vx: \002%vo\002  "    append s "%dx: \002%dr\002  %wx: \002%wr\002  %gx: \002%gv\002"  } elseif {$doing eq "x"} {  ;## exchange rate (second line) ##    set s "%cx: \002%cl\002  %ox: \002%op\002  %bx: \002%bi\002  "    append s "%ax: \002%as\002  %dx: \002%dr\002  %wx: \002%wr\002"  } else {    set s "%cx: \002%cl\002  %ox: \002%op\002  %bx: \002%bi\002  "    append s "%ax: \002%as\002  %dx: \002%dr\002  %vx: \002%vo\002  "    if {$doing eq "e"} {  append s "%yx: \002%yd\002"  ;# if is "e" (ETF) #    } else {  append s "%mx: \002%mc\002"  }   ;# else is "s" (stocks) #  }  lappend say $s  foreach ln $say {    set ln [string map $qmap $ln]  ;   set ln [string map $hmap $ln]    putserv "PRIVMSG $ch :$ln"  }  return 0}  ;# end:  proc bindpubm ############################################proc strim {str} {  return [regsub -all -- {\s{2,}} [string trim $str] { }]}proc sdigit {str} { return [string is digit -strict $str] }proc slower {str} { return [string tolower $str] }proc supper {str} { return [string toupper $str] }############################## unused setting variables #set yh(companylist_filename) "scripts/yhoo.companylist.txt"set yh(cmds_fq) ""proc onsource {} {   variable yh  set yh(chan) [split [slower [strim $yh(chan)]]]  set yh(companylist_filename) [strim $yh(companylist_filename)]  set yh(companydict) [dict create]  if {[file exists $yh(companylist_filename)]} {    set open [open $yh(companylist_filename) r]    set yh(companydict) [read -nonewline $open]   ;  close $open  }  foreach x {cmdchars cmds_q cmds_fq} {    set yh($x) [split [strim $yh($x)]]  }  foreach ybind [binds [namespace current]::bindpubm] {    lassign $ybind t f n h p  ;  unbind $t $f $n $p  }  foreach char $yh(cmdchars) {    bind pubm * "?%~\\${char}*" [namespace current]::bindpubm  }  set tmpls [split [slower [string trim $yh(cust_cmds)]] "\n"]  ;  set newls {}  foreach ln $tmpls {   set ln [strim $ln]    if {[llength [split $ln]] &lt; 2} {  continue  }    lappend newls " $ln "  }  set yh(cust_cmds) $newls}onsourceputlog "Loaded yhoo.tcl version 0.1  08Apr2023"}  ;## end of:  namespace eval yhoo ##</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Apr 11, 2023 7:54 pm</p><hr />
]]></content>
	</entry>
	</feed>
