Skip to content

Instantly share code, notes, and snippets.

@blippy
Created June 11, 2016 10:42
Show Gist options
  • Save blippy/d65a7dec33518d7224956a759110fa97 to your computer and use it in GitHub Desktop.
Save blippy/d65a7dec33518d7224956a759110fa97 to your computer and use it in GitHub Desktop.
Fetch a bunch of tickers, including USD
#!/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
@blippy
Copy link
Author

blippy commented Jun 11, 2016

Originally part of mcacc project

@blippy
Copy link
Author

blippy commented Jun 16, 2016

A more general implementation is: yahoo.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment