从谷歌获得实时股票报价 [英] Getting real time stock quote from google

查看:133
本文介绍了从谷歌获得实时股票报价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用谷歌股票API提取实时股票价格而不再有效:

I have been using the google stock API to pull the real time stock price and is no longer working:

http://finance.google.com/finance?output=json&q=msft

http://finance.google.com/finance?output=json&q=msft

是否有任何变通方法或更改内容?

Is there any workaround or anything changed?

提前致谢。非常感谢您的帮助。

Thanks in advance. Your help would be greatly appreciated.

推荐答案

您好wkpli,

Hi wkpli,

尝试下面的代码段来获取实时股票价格:

Try the code snippet below to get real time Stock Price:

     <style type="text/css">

    .StockName{font-size:1.5em;}
    .StockLastPrice{font-size:1.2em;}

    </style>

    <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <script type="text/javascript">


(document).ready(function(){

getStockPrice();
setInterval(getStockPrice,5000);
});

var EndPoint ='http://dev.markitondemand.com/Api/v2/Quote/jsonp';

函数getStockPrice(){
return
(document).ready(function () { getStockPrice(); setInterval(getStockPrice,5000); }); var EndPoint = 'http://dev.markitondemand.com/Api/v2/Quote/jsonp'; function getStockPrice () { return


.ajax({
url:EndPoint,
data:{symbol: "MSFT"},
dataType:'jsonp',
方法:'GET'
})。then(function(response){
.ajax({ url: EndPoint, data: {symbol: "MSFT"}, dataType: 'jsonp', method: 'GET' }).then(function (response) {


这篇关于从谷歌获得实时股票报价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆