NASDAQ/NYSE Stock Quote Checker

By DarthReven on Jun 27, 2005

this is a snippet that will check any NASDAQ stock granted that you know its symbol

;Use: /sq <-t/s> <stock symbol>
;;-t denotes that symbol is Nasdaq
;;-s denotes that symbol is NYSE
;Examples:
;;/sq -t goog <will retrive data on Google stock>
;;/sq -s hmc <will retrive data on Honda stock>
alias -l nohtml { 
  var %a,%b
  %b = $regsub($1,/[^<]*>|<[^>]*>|<[^>]*/g,$chr(32),%a)
  return %a
}
alias sq {
  if ($1) && ($2) {
    sockopen squote finance.lycos.com 80
    if ($1 == -t) { sockmark squote $+(NASDAQ,$chr(58),$2) | echo 4 -a [Stock Quote] - Getting info on $upper($2) }
    elseif ($1 == -s) { sockmark squote $+(NYSE,$chr(58),$2) | echo 4 -a [Stock Quote] - Getting info on $upper($2) }
  }
}
on *:sockopen:squote: { 
  sockwrite -n $sockname GET /qc/stocks/quotes.aspx?symbols= $+ $sock($sockname).mark HTTP/1.1
  sockwrite -n $sockname Host: mIRC $+(v,$version)
  sockwrite $sockname $crlf
}
on *:sockread:squote: {
  if (!$sockerr) {
    var %tmp
    sockread %tmp
    var %tmp $nohtml(%tmp)
    if (%tmp) {
      tokenize 32 %tmp
      if (!%chk) {
        if ($1-2 == Last price:) { echo 12 -a $1- }
        else {
          if ($1 == Bid:) { %chk = bid }
          elseif ($1 == Ask:) { %chk = ask }
          elseif ($1-2 == Day's Low) { %chk = dlah }
          elseif ($1 == Open:) { %chk = open }
          elseif ($1-2 == Previous Close:) { %chk = pc }
          elseif ($1-2 == Avg. Volume:) { %chk = volume }
        }
      }
      else {
        if (%chk == bid) { echo 12 -a Bid: $1- | unset %chk }
        elseif (%chk == ask) { echo 12 -a Ask: $1- | unset %chk }
        elseif (%chk == dlah) { echo 12 -a Day's Low & High: $1- | unset %chk }
        elseif (%chk == open) { echo 12 -a Open: $1- | unset %chk }
        elseif (%chk == pc) { echo 12 -a Previous Close: $1- | unset %chk }
        elseif (%chk == volume) { echo 12 -a Average Volume: $1- | echo 4 -a [Quote] - Completed... | unset %chk | sockclose squote }
      }
    }
  }
  else { echo -a [Error] - $sockerr }
}

Comments

Sign in to comment.
SpotRedDog   -  May 03, 2008

I do all the commands and then it fails to do anything after the read info lines tell you they are getting info on blah blah

 Respond  
Sasuke   -  Nov 08, 2005

Uhh, Kazuma, type /sq <-t/s>
for an examle /sq -t mIRC

 Respond  
`Kazuma   -  Nov 08, 2005

For some reason it\'s not working for me.

 Respond  
Sasuke   -  Nov 08, 2005

O__O How you do it, is beyond me.

Bows

 Respond  
Scruffy   -  Nov 08, 2005

I like it!

 Respond  
DeathRyder082   -  Jul 08, 2005

Lmao, if I didn\'t lose money in the markets I would use this code. But if you ask me the markets screwed me over, but in all good idea. :)

 Respond  
aeros   -  Jun 28, 2005

Nice.. stocks!

 Respond  
LIQUID_NiTrO   -  Jun 27, 2005

Awesome :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.