# Kim's Ticker Script 1.0 # Returns a 15-minute-delayed stock quote from Yahoo. # # Usage: !quote [symbol] # # [symbol] is the ticker symbol of any stock (NYSE, NASDAQ, over-the-counter, # etc.), mutual fund, corporate bond, etc. You can also use the following special # symbols: # # ^DJI -- Dow Jones Industrial Average # ^IXIC -- NASDAQ # ^SPC -- Standard & Poor's 500 Index # # etc. There are others you'll have to find for yourself. If you're not # sure of a particular ticker symbol, look it up at . # # This script is a simplified (and improved, I daresay) version of Wacko's Stock Quote. # Check for updated versions at . # # Written by Kim Scarborough . # bind pub - !quote pub_quote proc pub_quote {nick mask hand chan arg} { if {$arg != "" } { set stock [string toupper [lindex $arg 0]] set all [exec /usr/bin/fetch -q -o - "http://finance.yahoo.com/d/quotes.csv?s=${stock}&f=nl1d1t1c1vw&e=.csv"] regsub -all \" $all "" all set all [split $all ","] putserv "PRIVMSG $chan :\002[lindex $all 0]\002 -> [lindex $all 2] [lindex $all 3]" putserv "PRIVMSG $chan :\002Last Trade\002 [lindex $all 1]" putserv "PRIVMSG $chan :\002Change\002 [lindex $all 4]" putserv "PRIVMSG $chan :\002Volume\002 [lindex $all 5]" putserv "PRIVMSG $chan :\00252 Week Range\002 [lindex $all 6]" } } putlog "Ticker Script loaded"