[Olug-list] Get SCO
Terje Trane
trane at systek.no
Mon, 15 Mar 2004 20:57:19 +0100
For de som ønsker å følge med på SCOs aksjekurs mens den går ned følger et
lite script
Hentet fra yahoos messageboard og endret fra lynx til links. Endre tilbake
om nødvendig.
Det er noen minutters forsinkelse (mindre enn 20) for å ikke konkurere med
tjenester du må betale for.
#!/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"
# Command used to download Example: lynx -source or links -source
BROWSCMD="links -source"
$BROWSCMD
"http://finance.yahoo.com/d/quotes.csv?s=SCOX&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
#sample of scox.csv file
#"SCOX",9.80,"3/11/2004","12:46pm",+0.29,9.30,10.18,9.30,377634