Wednesday, July 1, 2009

Stock Quotes on your Desktop with Conky

Stock Quotes on your Desktop with Conky

by Bhavik | February 27, 2009 | In Linux | 435 views

I wrote another script today to save me from needing to open up a browser.
The old process for stock quotes was, go to yahoo, type in each stock, get the price.
The new process involves only directing my attention to the bottom right corner of my desktop. All stocks of interest are lined up inside my conky. They auto refresh every 2 minutes for me. I can see the current value, what it opened at, and the change.

If you don’t know what conky is click here for my conky tutorial.

To get it working, download the script and add the following line to your .conkyrc

${execi 120 python /path/to/script/stocks.py stock1 stock2 stock3}

Replace 120 with your interval, use your path to the script, and change the stocks to actual stock quotes.
Example:

{execi 120 python /home/bhavik/scripts/stocks.py goog msft aapl}

Hope it helps any of the linux users out there that also like to trade =)

Changes:
3/5/09 - Removed decimal conversion to float…
If the market was closed the value was N/A.
Since you can’t convert a string to float it was getting errors.
Should be good now.

Screenshot
conky_stocks_screenshot
by Bhavik | February 27, 2009 | In Linux | 435 views

I wrote another script today to save me from needing to open up a browser.
The old process for stock quotes was, go to yahoo, type in each stock, get the price.
The new process involves only directing my attention to the bottom right corner of my desktop. All stocks of interest are lined up inside my conky. They auto refresh every 2 minutes for me. I can see the current value, what it opened at, and the change.

If you don’t know what conky is click here for my conky tutorial.

To get it working, download the script and add the following line to your .conkyrc

${execi 120 python /path/to/script/stocks.py stock1 stock2 stock3}

Replace 120 with your interval, use your path to the script, and change the stocks to actual stock quotes.
Example:

{execi 120 python /home/bhavik/scripts/stocks.py goog msft aapl}

Hope it helps any of the linux users out there that also like to trade =)

Changes:
3/5/09 - Removed decimal conversion to float…
If the market was closed the value was N/A.
Since you can’t convert a string to float it was getting errors.
Should be good now.

Screenshot
conky_stocks_screenshot

0 comments: