Displaying stocks on your mac desktop


If you are into trading and have mac and want to be really update with your stock market, here is a little tip:

Install Geektool 3 download my little Yahoo Script and you can display any symbol right on your desktop. Set your own custom refresh rate.

It display red when negative, green when positive and white when stale.

Feel free to use it, and modify it the Yahoo Codes are here


#!/bin/bash
STOCK=$1
VALUE=`curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=$STOCK&f=l1"`
GAIN=`curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=$STOCK&f=c1"`
GAINP=`curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=$STOCK&f=p2"|sed -e 's/"//g'`

ESC=`printf "\e"`
WAY=`echo $GAIN|grep "^-" -c`

ZERO=`echo $GAIN|grep "^0.000" -c`

if [ "$ZERO" == "1" ]; then
echo "$ESC[37m $STOCK $VALUE $GAINP $ESC[0m"
elif [ "$WAY" == "1" ]; then
echo "$ESC[31m $STOCK $VALUE $GAINP $ESC[0m"
else
echo "$ESC[32m $STOCK $VALUE $GAINP $ESC[0m"
fi

, ,

  1. #1 by scott on March 31, 2010 - 12:14

    Brilliant thanks petr just what i was looking for !!!

(will not be published)