Realtime stock API

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Fri May 7 04:45:42 UTC 2004


On Wed, May 05, 2004 at 09:29:12PM -0400, Sidney Shapiro wrote

> We have also been looking into 15 minute delayed quotes, as it
> seems much more affordable and obtainable. Any ideas / resources
> for slightly delayed quotes? I would be looking to spend something
> in the $2-500US a month range for the datafeed/API

  See attached script "quotes".  It pulls 20-minute delayed data from
finance.yahoo.com, spits out results, in colour yet.  To get IBM or MSFT

./quotes IBM

./quotes MSFT

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
Email users are divided into two classes;
1) Those who have effective spam-blocking
2) Those who wish they did
-------------- next part --------------
#!/bin/sh
#getscox - Free to use and modify!!
# Colors for output
red='\E[31;40m'
green='\E[32;40m'
white='\E[37;40m'
yellow='\E[33;40m'
bold="\033[1m"
normal="\033[0m"


lynx -source "http://finance.yahoo.com/d/quotes.csv?s=${1}&f=sl1d1t1c1ohgv&e=.csv" > scox.csv
ARRAY=(`sed s/[,\"]/\ /g < scox.csv`)
COMPANY=${ARRAY[0]}

SIGN=${ARRAY[4]:0:1}
if [ "$SIGN" = "+" ];
then COLOR=$green
else
COLOR=$red
fi

echo -en $bold"Company" $yellow$COMPANY$normal
echo -en $bold "Date" '\E[33;40m'${ARRAY[2]}$normal
echo -e $bold "Time" $yellow${ARRAY[3]}$normal
echo -en $bold"Current" $yellow${ARRAY[1]}$normal
echo -en $bold "Change"$COLOR ${ARRAY[4]}$normal
echo -e $bold "Volume"$yellow ${ARRAY[8]}$normal
echo -en $bold"Open" $yellow${ARRAY[5]}$normal
echo -e $bold "High" $yellow${ARRAY[6]}$normal


tput sgr0


More information about the Legacy mailing list