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 19965 days, 1 hours, 42 minutes ago.