After reading what underdog discovered about Yahoo Finance’s streamerapi I decided to get try to the data directly into an HTML page in IE8.
Go to Yahoo finance and with IE8′s debugger set a breakpoint in the yfs_concat.js file on the loadUrl (214) with a watch on url to get the streamerapi call.
Open that URL in IE8 and the status bar starts filling so we can see something is happening. Right click and view source to see the stream of script commands.
Monitoring the feed with wireshark
GET /streamer/1.0?s=DX-Y.NYB,AUDUSD=X,EURUSD=X,USDJPY=X,GBPUSD=X,CLF10.NYM,GCZ09.CMX,USD=X,^GSPC,^IXIC,^DJI&
k=c10,l10,p20,t10&callback=parent.yfs_u1f&mktmcb=parent.yfs_mktmcb&gencallback=parent.yfs_gencb HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap,
application/x-shockwave-flash, */*
Accept-Language: en-AU,zh-TW;q=0.5
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727;
.NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Accept-Encoding: gzip, deflate
Host: streamerapi.finance.yahoo.com
Connection: Keep-Alive
Cookie: B=dpcg5595g36bh&b=3&s=qb; adx=c83020@1259630968@1; YSC=0; Q=q1=AACAAAAAAAAAAA--&q2=SxeGOg--;
PRF=&t=EURUSD=X+GCZ09.CMX+CLF10.NYM+DX-Y.NYB+EURUSD%3DX+AUDUSD%3DX+AUDUSD%3DX+AUDUSD&cp=interactive&
cd=symbol%3Agcz09.cmx_@range%3A5d_@indicator%3Avolume_@charttype%3Aline_@crosshair%3Aon_@ohlcvalues%3A0_@
logscale%3Aon_@source%3Aundefined; TT=tick1=0&tick2=0&tick3=1
HTTP/1.1 200 OK
Cache-Control: private
Connection: Keep-Alive
Server: Yahoo! Finance Push Server - v1.0.3
Content-Type: text/html
<html><head><script type='text/javascript'> document.domain='finance.yahoo.com';</script> </head><body></body>
<script>try{parent.yfs_u1f({"USD=X":{l10:"1.00",c10:"0.00",p20:"0.00"}});}catch(e){}</script>
<script>try{parent.yfs_u1f({"^IXIC":{l10:"2214.47",c10:"+13.42",p20:"+0.61"}});}catch(e){}</script>
<script>try{parent.yfs_u1f({"^DJI":{l10:"10497.42",c10:"+45.42",p20:"+0.43"}});}catch(e){}</script>
<script>try{parent.yfs_u1f({"GBPUSD=X":{l10:"1.6386",c10:"+0.0117",p20:"+0.72"}});}catch(e){}</script>
<script>try{parent.yfs_u1f({"AUDUSD=X":{l10:"0.9012",c10:"-0.0048",p20:"-0.52"}});}catch(e){}</script>
shows Yahoo opens an HTTP connection, sends a head and body tags and then slowly sends a series of script tags without ever sending a