stock.frink

Download or view 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
}


Download or view 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 19966 days, 18 hours, 18 minutes ago.