stock.frink

View or download stock.frink in plain text format


// Program to fetch stock prices.  Try the stocktest.frink program for an
// interactive version.

stock[symbol] := 
{
   url = "http://finance.yahoo.com/q?s=" + symbol
   file = read[url]

   if [price] = ( file =~ %r/Last Trade.*?<span id=".*?">(\d+\.\d+)<\/span>/si )
      return eval[price + " USD"]
   else
      return undef
}


View or download stock.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17646 days, 9 hours, 37 minutes ago.