Created
June 11, 2016 10:42
-
-
Save blippy/d65a7dec33518d7224956a759110fa97 to your computer and use it in GitHub Desktop.
Fetch a bunch of tickers, including USD
This file contains hidden or 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
| #!/usr/bin/env bash | |
| w=$HOME/.mca/work | |
| s1=$w/s1 | |
| cd $w/s2 | |
| # dollar exchange rate | |
| url="http://download.finance.yahoo.com/d/quotes.csv?s=USDGBP=X&f=nl1d1t1" | |
| curl -s -L $url > usd.csv & | |
| # symbols that need to be downloaded | |
| PRE="http://download.finance.yahoo.com/d/quotes.csv?s=" | |
| POST="&f=sl1c1p2&e=.csv" | |
| rm -f yfetch.csv | |
| while read SYM | |
| do | |
| URL="$PRE$SYM$POST" | |
| #echo $URL | |
| curl -s -L $URL >> yfetch.csv & | |
| #echo $URL >>yftech.csv & | |
| done < <(awk '$2 == "W" { print $1}' $s1/comm.dsv) | |
| wait | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally part of mcacc project