Why no action in Sudan?
April 13, 2006
I ran across this financial times article today.
http://news.ft.com/cms/s/827e63a0-cae5-11da-9015-0000779e2340.html
What's the connection between Sudan and Chad, you say? Well, not much unless you first understand that Chad is an oil rich country and is under attack by rebels. Now, rebel attacks in Africa isn't news nowadays, but what IS news is that the Chad president, Deby, claims the Sudanese government is funding the rebels. Now, hmmm, the west turns a blind eye towards the atrocities in Sudan, whlie the Sudanese goverment destabilizes Chad, and oil rich country. What's the connection? Hard to tell, but it sure seems like someone is out to gain control of Chad's oil supply, and it isn't Sudan that will get to keep it.
Changed out the spark plugs
April 11, 2006
Changed out the spark plugs in the '02 accord today. It was about as easy as it could get. I basically ordered the OEM plugs from Amazon, unscrewed the old ones, and screwed in the new ones. Make sure to heed the warning on the box NOT to gap the spark plugs. They are pre-gapped by the manufacturer.
Nifty script to get quotes from yahoo stock feed
April 11, 2006
I wrote this quick python script to pull down stock quotes from the yahoo server. I'd like to figure out how to get it to retrieve historical data as well.
# Retrieve the stock quote, and additional specified info according to the
#following table, which maps to the yahoo quote service data/key matrix
import sys
import os
import urllib
import re
class YahooStockQuoter:
def __init__(self):
self.baseUrl = "http://quote.yahoo.com/d/quotes.csv?s="
def getQuote(self,symbol,args):
url = self.baseUrl + symbol + "&f=" + args
try:
quoteInfo = urllib.urlopen(url).read()
except(e),x:
print e + x
else:
#Strip out the simple HTML tags present in the reply
quoteInfo = re.sub("<.*?>",'',quoteInfo)
return quoteInfo
if __name__ == '__main__':
if len(sys.argv) < 2:
print "Usage: %s Stock/Option_symbol additional_args" % sys.argv[0]
print "If no args are give, then the symbol, and last price are retrieved"
exit
if len(sys.argv)==2:
print "Using default args for symbol, and last price"
args="snl"
else:
args=sys.argv[2]
quoter = YahooStockQuoter()
quote = quoter.getQuote(sys.argv[1],args)
print quote
#a Ask
#b Bid
#b4 Book Value
#c1 Change
#c8 After Hours Change (Real-time)
#d2 Trade Date
#e7 EPS Estimate Current Year
#f6 Float Shares
#j 52-week Low
#g3 Annualized Gain
#g6 Holdings Gain (Real-time)
#j1 Market Capitalization
#j5 Change From 52-week Low
#k2 Change Percent (Real-time)
#k5 Percebt Change From 52-week High
#l2 High Limit
#m2 Day's Range (Real-time)
#m5 Change From 200-day Moving Average
#m8 Percent Change From 50-day Moving Average
#o Open
#p2 Change in Percent
#q Ex-Dividend Date
#r2 P/E Ratio (Real-time)
#r7 Price/EPS Estimate Next Year
#s7 Short Ratio
#t7 Ticker Trend
#v1 Holdings Value
#w1 Day's Value Change
#y Dividend Yield
#a2 Average Daily Volume
#b2 Ask (Real-time)
#b6 Bid Size
#c3 Commission
#d Dividend/Share
#e Earnings/Share
#e8 EPS Estimate Next Year
#g Day's Low
#k 52-week High
#g4 Holdings Gain
#i More Info
#j3 Market Cap (Real-time)
#j6 Percent Change From 52-week Low
#k3 Last Trade Size
#l Last Trade (With Time)
#l3 Low Limit
#m3 50-day Moving Average
#m6 Percent Change From 200-day Moving Average
#n Name
#p Previous Close
#p5 Price/Sales
#r P/E Ratio
#r5 PEG Ratio
#s Symbol
#t1 Last Trade Time
#t8 1 yr Target Price
#v7 Holdings Value (Real-time)
#w4 Day's Value Change (Real-time)
#a5 Ask Size
#b3 Bid (Real-time)
#c Change & Percent Change
#c6 Change (Real-time)
#d1 Last Trade Date
#e1 Error Indication (returned for symbol changed / invalid)
#e9 EPS Estimate Next Quarter
#h Day's High
#g1 Holdings Gain Percent
#g5 Holdings Gain Percent (Real-time)
#i5 Order Book (Real-time)
#j4 EBITDA
#k1 Last Trade (Real-time) With Time
#k4 Change From 52-week High
#l1 Last Trade (Price Only)
#m Day's Range
#m4 200-day Moving Average
#m7 Change From 50-day Moving Average
#n4 Notes
#p1 Price Paid
#p6 Price/Book
#r1 Dividend Pay Date
#r6 Price/EPS Estimate Current Year
#s1 Shares Owned
#t6 Trade Links
#v Volume
#w 52-week Range
#x Stock Exchange


