If you use Google Finance, you see the stock price update in real time. However, I do not see ajax requests for each price change. How exactly is it receiving it's data? The ajax calls do happen every so often but not for every price change.
如果您使用Google财经,则会实时看到股票价格更新。但是,我没有看到每个价格变化的ajax请求。它究竟是如何接收数据的呢? ajax调用确实经常发生,但不是每次价格变化都会发生。
https://www.google.com/finance?q=aapl
2 个解决方案
#1
2
It is true that the graph is supplied by flash, but the price of the stock is in HTML and updated in real time.
确实,图表是由闪存提供的,但股票的价格是HTML格式并实时更新。
By looking at the connections, you'll notice that one of the connection stays open. My guess is that it provides the data:
通过查看连接,您会注意到其中一个连接保持打开状态。我的猜测是它提供的数据:
#2
1
The graph is supplied by Adobe Flash Player so I don't think you'd see any traffic via inspector for that. The rest though does generate calls:
该图表由Adobe Flash Player提供,因此我认为您不会通过检查员看到任何流量。其余的确会生成调用:
https://www.google.com/finance/getprices?q=AAPL&x=NASD&i=120&p=25m&f=d,c,v,o,h,l&df=cpct&auto=1&ts=1368199239667&ei=jw-NUcivEsmrqQGT7wE
would be an example of what I'm seeing.
将是我所看到的一个例子。
Here's is the response from the server:
这是来自服务器的响应:
EXCHANGE%3DNASDAQ
MARKET_OPEN_MINUTE=570
MARKET_CLOSE_MINUTE=960
INTERVAL=120
COLUMNS=DATE,CLOSE,HIGH,LOW,OPEN,VOLUME
DATA=
TIMEZONE_OFFSET=-240
a1368197880,452.2847,452.29,451.6,452.0101,35458
1,451.81,452.3,451.661,452.24,91267
2,452.2,452.3,451.8314,451.84,35767
3,451.91,452.3,451.8,452.3,89882
4,452.4575,452.61,451.88,451.88,45130
5,452.77,452.88,452.45,452.48,35866
6,453.626,453.9,453.27,453.3571,0
7,453.05,453.6599,453,453.61,0
8,452.9,453.17,452.83,453.09,0
9,452.58,453.15,452.4377,452.865,0
10,452.7568,453.068,452.45,452.475,0
11,452.53,452.8,452.302,452.75,0
The other call is makes is to:
另一个电话是:
https://www.google.com/finance/qs/channel?VER=8&SID=6C5BE78E1E7D9597&RID=82123&AID=500&zx=p0b0io9ifynn&t=1
which responds with something like:
它的响应类似于:
10
[1,500,0]
#1
2
It is true that the graph is supplied by flash, but the price of the stock is in HTML and updated in real time.
确实,图表是由闪存提供的,但股票的价格是HTML格式并实时更新。
By looking at the connections, you'll notice that one of the connection stays open. My guess is that it provides the data:
通过查看连接,您会注意到其中一个连接保持打开状态。我的猜测是它提供的数据:
#2
1
The graph is supplied by Adobe Flash Player so I don't think you'd see any traffic via inspector for that. The rest though does generate calls:
该图表由Adobe Flash Player提供,因此我认为您不会通过检查员看到任何流量。其余的确会生成调用:
https://www.google.com/finance/getprices?q=AAPL&x=NASD&i=120&p=25m&f=d,c,v,o,h,l&df=cpct&auto=1&ts=1368199239667&ei=jw-NUcivEsmrqQGT7wE
would be an example of what I'm seeing.
将是我所看到的一个例子。
Here's is the response from the server:
这是来自服务器的响应:
EXCHANGE%3DNASDAQ
MARKET_OPEN_MINUTE=570
MARKET_CLOSE_MINUTE=960
INTERVAL=120
COLUMNS=DATE,CLOSE,HIGH,LOW,OPEN,VOLUME
DATA=
TIMEZONE_OFFSET=-240
a1368197880,452.2847,452.29,451.6,452.0101,35458
1,451.81,452.3,451.661,452.24,91267
2,452.2,452.3,451.8314,451.84,35767
3,451.91,452.3,451.8,452.3,89882
4,452.4575,452.61,451.88,451.88,45130
5,452.77,452.88,452.45,452.48,35866
6,453.626,453.9,453.27,453.3571,0
7,453.05,453.6599,453,453.61,0
8,452.9,453.17,452.83,453.09,0
9,452.58,453.15,452.4377,452.865,0
10,452.7568,453.068,452.45,452.475,0
11,452.53,452.8,452.302,452.75,0
The other call is makes is to:
另一个电话是:
https://www.google.com/finance/qs/channel?VER=8&SID=6C5BE78E1E7D9597&RID=82123&AID=500&zx=p0b0io9ifynn&t=1
which responds with something like:
它的响应类似于:
10
[1,500,0]