egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

update for stock.tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Icari
Voice


Joined: 01 Dec 2008
Posts: 4

PostPosted: Mon Dec 01, 2008 5:55 pm    Post subject: update for stock.tcl Reply with quote

this is an update for the following tcl script http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&id=1524
The orginal script works fine just the links to yahoo got updated in this version to work.

Code:

####################################################################################
# Stock.tcl - 06/082008 by Liem, blu3 - www.suplemen.com
# Realtime stock quotes, DOW, NASDAQ and S&P information
#
# Supported by:
#      http://www.usenix.org/publications/login/1999-10/features/tclsh.html
#   http://www.tec.ufl.edu/~flooxs/cur/TclTk/tcl8.0/http.n.html
#
# Special thx to #brilliant
#
#
# .-------------------------------------------------------------------------------.
#:           Usage - All Commands Are Performed In the Channel Publically         :
#:--------------------------------------------------------------------------------:
#:  !stockhelp        |  HELP                                               :
#:  !stock <Symbol>   |  Show stock price; ex: !stock TLKM             :
#:  !dow          |  DJ INDU AVERAGE                                    :
#:  !nasdaq          |  NAS/NMS COMPSITE                                   :
#:  !s&p          |  S&P 500 INDEX                                      :
#:  !10yearTN       |  10-YEAR TREASURY NOTE (U.S)                        :
#:  !hsi          |  HANG SENG INDEX (^HSI)                             :
#:  !nikkei          |  NIKKEI 225 (^N225)                                 :
#:  !nikkei300       |  NIKKEI 300 (^N300)                                 :
#:  !seoul          |  KOSPI Composite Index                              :
#:  !STI          |  Straits Times Index                                :
#:  !taiwan          |  TSEC weighted index (^TWII)                        :
#:  !ftse          |  FTSE 100 (^FTSE)                                   :
#:  !oil          |  Crude Oil Jan 08 (CLF08.NYM)                       :
#:  !gold          |  Gold Nov 07 (GCX07.CMX)                            :
# ._______________________________________________________________________________.
#
# rm -rf /bin/laden
#####################################################################################

package require http

bind pub - !stockhelp pub:quotehelp
bind pub - !stock pub:quote
bind pub - !ihsg pub:ihsg
bind pub - !dow pub:dow
bind pub - !nasdaq pub:nasdaq
bind pub - !s&p pub:sandp
bind pub - !hsi pub:hsi
bind pub - !sti pub:sti
bind pub - !nikkei pub:nikkei
bind pub - !seoul pub:seoul
bind pub - !taiwan pub:taiwan
bind pub - !ftse pub:ftse
bind pub - !10yearTN pub:10yearTN
bind pub - !oil pub:oil
bind pub - !gold pub:gold

proc pub:quotehelp { nick uhost handle channel arg } {
   putserv "NOTICE $channel :Indeks (Real Time) - !dow !nasdaq ! !s&p !hsi !nikkei !seoul !sti !taiwan !ftse"
   putserv "NOTICE $channel :Commodity (Real Time) - !oil !gold"
   putserv "NOTICE $channel :Other (Real Time) - !10yearTN"
   putserv "NOTICE $channel :-"
   putserv "NOTICE $channel :Stock - !Stock <symbol>"
   putserv "NOTICE $channel :Ex: !stock TLKM"
   }


proc pub:quote { nick uhost handle channel arg } {
   if {[llength $arg]==0} {
         putserv "PRIVMSG $channel :!stock Type (!stock CODE) - eg !stock TLKM - Type !stockhelp for Option"
      } else {
           set stock [string toupper [lindex $arg 0]]
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=$stock&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]
   
      #debug below
      #putserv "PRIVMSG $channel :\002STOCK: $stock "
      #putserv "PRIVMSG $channel :\002QUERY: $query "   

      #If stock price is 0.00 the stock most likely doesn't exist.
      if {[lindex $all 3]!="N/A"} {
         if {[lindex $plus 1]!=""} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> \00302[lindex $all 2]\003 | \002Last\002\00303  [lindex $all 1] \003 (\00303[lindex $all 4]\003) | \002Vol.\002  [lindex $all 5] | \00252 Week Range\002 [lindex $all 6]"
         } else {
            if {[lindex $all 4]!="0"} {
               putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> \00302[lindex $all 2]\003 | \002Last\002\00304  [lindex $all 1] \003 (\00304[lindex $all 4]\003) | \002Vol.\002  [lindex $all 5] | \00252 Week Range\002 [lindex $all 6]"
            } else {
               putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> \00302[lindex $all 2]\003 | \002Last\002  [lindex $all 1] ([lindex $all 4]) | \002Vol.\002  [lindex $all 5] | \00252 Week Range\002 [lindex $all 6]"
            }
         }

      } else {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> Stock not found"
      }
     }
}


proc pub:gold { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=GCZ08.CMX"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Gold Price) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Gold Price) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Gold Price) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
   
}

proc pub:oil { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=CLF09.NYM&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Crude Oil Price) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Crude Oil Price) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Crude Oil Price) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:ihsg { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EJKSE&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Jakarta Composite Index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Jakarta Composite Index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Jakarta Composite Index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:dow { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=^DJI"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (DJ INDU AVERAGE) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (DJ INDU AVERAGE) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (DJ INDU AVERAGE) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:nikkei { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EN225&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NIKKEI 225) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NIKKEI 225) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NIKKEI 225) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:ftse { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EFTSE&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (FTSE 100) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (FTSE 100) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (FTSE 100) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:taiwan { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5ETWII&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (TSEC weighted index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (TSEC weighted index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (TSEC weighted index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:seoul { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EKS11&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (KOSPI Composite Index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (KOSPI Composite Index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (KOSPI Composite Index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }   
}

proc pub:10yearTN { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5ETNX&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (10-YEAR TREASURY NOTE) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (10-YEAR TREASURY NOTE) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (10-YEAR TREASURY NOTE) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}


proc pub:nasdaq { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EIXIC&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NASDAQ COMPOSITE) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NASDAQ COMPOSITE) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NASDAQ COMPOSITE) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:sti { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5ESTI&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Straits Times Index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Straits Times Index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Straits Times Index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:hsi { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EHSI&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (HANG SENG INDEX) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (HANG SENG INDEX) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (HANG SENG INDEX) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}


proc pub:sandp { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EGSPC&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (S&P 500 INDEX) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (S&P 500 INDEX) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (S&P 500 INDEX) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}


putlog "Stock.tcl v1.1 - 23/102007 by Liem, blu3 - www.suplemen.com LOADED.."
Back to top
View user's profile Send private message
the_Wizard
Voice


Joined: 17 Jun 2014
Posts: 2

PostPosted: Tue Jun 17, 2014 5:58 am    Post subject: Reply with quote

I was unable to find a way to fix the weird dow jones bug.

Updates:
- Gold and Oil actualized to June 2014
- Added Silver
- Added information for actualizing future versions in the readme.

Code:
####################################################################################
# Stock.tcl - 06/082008 by Liem, blu3 - www.suplemen.com
# Updated 12/2008 by Icari
# Realtime stock quotes, DOW, NASDAQ and S&P information
#
# Supported by:
#      http://www.usenix.org/publications/login/1999-10/features/tclsh.html
#   http://www.tec.ufl.edu/~flooxs/cur/TclTk/tcl8.0/http.n.html
#
# Special thx to #brilliant
#
#
# .-------------------------------------------------------------------------------.
#:           Usage - All Commands Are Performed In the Channel Publically         :
#:--------------------------------------------------------------------------------:
#:  !stockhelp      |  HELP                                               :
#:  !stock <Symbol> |  Show stock price; ex: !stock TLKM               :
#:  !dow          |  DJ INDU AVERAGE                                    :
#:  !nasdaq          |  NAS/NMS COMPSITE                                   :
#:  !s&p          |  S&P 500 INDEX                                      :
#:  !10yearTN       |  10-YEAR TREASURY NOTE (U.S)                        :
#:  !hsi          |  HANG SENG INDEX (^HSI)                             :
#:  !nikkei          |  NIKKEI 225 (^N225)                                 :
#:  !nikkei300       |  NIKKEI 300 (^N300)                                 :
#:  !seoul          |  KOSPI Composite Index                              :
#:  !STI          |  Straits Times Index                                :
#:  !taiwan          |  TSEC weighted index (^TWII)                        :
#:  !ftse          |  FTSE 100 (^FTSE)                                   :
#:  !oil          |  Crude Oil Jan 08 (CLF08.NYM)                       :
#:  !gold          |  Gold Nov 07 (GCX07.CMX)                            :
#:  !silver         |  Silver Jun 14 (SIM14.CMX)
# ._______________________________________________________________________________.
#
#  Silver added & actualized by the_Wizard. Some notes:
#
#  To actualize in the future, visit this site for commodity filenames
#  https://finance.yahoo.com/futures
#
#  To actualize in the future, visit this site for stock filenames
#  https://finance.yahoo.com/
#
#####################################################################################

package require http

bind pub - !stockhelp pub:quotehelp
bind pub - !stock pub:quote
bind pub - !ihsg pub:ihsg
bind pub - !dow pub:dow
bind pub - !nasdaq pub:nasdaq
bind pub - !s&p pub:sandp
bind pub - !hsi pub:hsi
bind pub - !sti pub:sti
bind pub - !nikkei pub:nikkei
bind pub - !seoul pub:seoul
bind pub - !taiwan pub:taiwan
bind pub - !ftse pub:ftse
bind pub - !10yearTN pub:10yearTN
bind pub - !oil pub:oil
bind pub - !gold pub:gold
bind pub - !silver pub:silver

proc pub:quotehelp { nick uhost handle channel arg } {
   putserv "NOTICE $channel :Index (Real Time) - !dow !nasdaq ! !s&p !hsi !nikkei !seoul !sti !taiwan !ftse"
   putserv "NOTICE $channel :Commodity (Real Time) - !oil !gold !silver"
   putserv "NOTICE $channel :Other (Real Time) - !10yearTN"
   putserv "NOTICE $channel :-"
   putserv "NOTICE $channel :Stock - !Stock <symbol>"
   putserv "NOTICE $channel :Ex: !stock TLKM"
   }


proc pub:quote { nick uhost handle channel arg } {
   if {[llength $arg]==0} {
         putserv "PRIVMSG $channel :!stock Type (!stock CODE) - eg !stock TLKM - Type !stockhelp for Option"
      } else {
           set stock [string toupper [lindex $arg 0]]
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=$stock&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]
   
      #debug below
      #putserv "PRIVMSG $channel :\002STOCK: $stock "
      #putserv "PRIVMSG $channel :\002QUERY: $query "   

      #If stock price is 0.00 the stock most likely doesn't exist.
      if {[lindex $all 3]!="N/A"} {
         if {[lindex $plus 1]!=""} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> \00302[lindex $all 2]\003 | \002Last\002\00303  [lindex $all 1] \003 (\00303[lindex $all 4]\003) | \002Vol.\002  [lindex $all 5] | \00252 Week Range\002 [lindex $all 6]"
         } else {
            if {[lindex $all 4]!="0"} {
               putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> \00302[lindex $all 2]\003 | \002Last\002\00304  [lindex $all 1] \003 (\00304[lindex $all 4]\003) | \002Vol.\002  [lindex $all 5] | \00252 Week Range\002 [lindex $all 6]"
            } else {
               putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> \00302[lindex $all 2]\003 | \002Last\002  [lindex $all 1] ([lindex $all 4]) | \002Vol.\002  [lindex $all 5] | \00252 Week Range\002 [lindex $all 6]"
            }
         }

      } else {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 -> Stock not found"
      }
     }
}


proc pub:gold { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=GCN14.CMX"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Gold Price) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Gold Price) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Gold Price) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
   
}

proc pub:oil { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=CLN14.NYM&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Crude Oil Price) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Crude Oil Price) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Crude Oil Price) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:silver { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=SIM14.CMX&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Silver Price) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Silver Price) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Silver Price) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:ihsg { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EJKSE&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Jakarta Composite Index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Jakarta Composite Index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Jakarta Composite Index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:dow { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EDJI&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (DJ INDU AVERAGE) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (DJ INDU AVERAGE) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (DJ INDU AVERAGE) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:nikkei { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EN225&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NIKKEI 225) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NIKKEI 225) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NIKKEI 225) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:ftse { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EFTSE&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (FTSE 100) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (FTSE 100) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (FTSE 100) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:taiwan { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5ETWII&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (TSEC weighted index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (TSEC weighted index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (TSEC weighted index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:seoul { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EKS11&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (KOSPI Composite Index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (KOSPI Composite Index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (KOSPI Composite Index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }   
}

proc pub:10yearTN { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5ETNX&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (10-YEAR TREASURY NOTE) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (10-YEAR TREASURY NOTE) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (10-YEAR TREASURY NOTE) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}


proc pub:nasdaq { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EIXIC&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NASDAQ COMPOSITE) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NASDAQ COMPOSITE) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (NASDAQ COMPOSITE) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:sti { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5ESTI&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Straits Times Index) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Straits Times Index) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (Straits Times Index) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}

proc pub:hsi { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EHSI&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (HANG SENG INDEX) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (HANG SENG INDEX) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (HANG SENG INDEX) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}


proc pub:sandp { nick uhost handle channel arg } {
      set query "http://download.finance.yahoo.com/d/quotes.csv?s=%5EGSPC&f=sl1d1t1c1ohgv&e=.csv"
      set token [http::geturl $query]
      set all [http::data $token]       
      regsub -all \" $all "" all
      set plus [split $all "+"]
      set all [split $all ","]

      if {[lindex $plus 1]!=""} {
         putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (S&P 500 INDEX) -> \00303[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
      } else {
         if {[lindex $all 4]!="0"} {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (S&P 500 INDEX) -> \00304[lindex $all 1] [lindex $all 4]\003 | [lindex $all 2] [lindex $all 3]"
         } else {
            putserv "PRIVMSG $channel :\002[lindex $all 0]\002 (S&P 500 INDEX) -> [lindex $all 1] [lindex $all 4] | [lindex $all 2] [lindex $all 3]"
         }
      }
}


putlog "Stock.tcl v1.1 - 23/102007 by Liem, blu3 - www.suplemen.com LOADED.."
Back to top
View user's profile Send private message
Dalek
Voice


Joined: 21 Jun 2014
Posts: 1

PostPosted: Sat Jun 21, 2014 8:47 am    Post subject: Reply with quote

Hi,

I appreciate the script, but was wondering if this could be added? I believe it would be useful to stocks, but if it's too much effort then don't bother. Smile

I wanted something like this: bitstampUSD: $500, krakenUSD: $500, bitfinexUSD: $500, btceUSD: $500 with command !bitcoin, would this be possible? Also it would be awesome if you could add litecoin. Smile
Back to top
View user's profile Send private message
darla
Voice


Joined: 17 Sep 2014
Posts: 2

PostPosted: Wed Oct 01, 2014 2:10 am    Post subject: Reply with quote

I appreciate the script, but was wondering if this could be added? I believe it would be useful to stocks, but if it's too much effort then don't bother. Smile
_________________
http://www.maryville.edu/
pass-4-sure.com
http://www.icdl.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber