Created
December 7, 2014 04:09
-
-
Save dmitry-a-morozov/11a5afee5edc8e7952dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Symbology | |
open System | |
let yahoo symbol = | |
use wc = new Net.WebClient() | |
let yahoo = "http://download.finance.yahoo.com/d" | |
let uri = sprintf "%s/quotes.csv?s&f=nl1" yahoo symbol | |
wc.DownloadString(uri) | |
.Split([| "\n\r" |], StringSplitOptions.RemoveEmptyEntries) | |
|> Array.map (fun line -> | |
let xs = line.Split(',') | |
let name, price = xs.[0], xs.[1] | |
if price = "0.00" then None else Some name | |
) | |
|> Seq.exactlyOne |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment