Google RSS和Ajax昨天停止了工作

时间:2015-12-02 21:21:06

标签: jquery ajax rss

直到昨天,这段代码才有效。但今天我有这个错误:

TypeError:xml.responseData为null

CODE:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

<script>
        $(function(){



var object001 = new Object(); 

        url = 'https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&csid=09160b44f4732e03&output=rss';
        $.ajax({
        type: "GET",
        url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' + encodeURIComponent(url),
        dataType: 'json',
        error: function(){
            alert('Error!');
        },
        success: function(xml){
            var values = xml.responseData.feed.entries;
            console.log(values);


        }
    });
    });
</script>

任何人都知道为什么?谢谢!

1 个答案:

答案 0 :(得分:1)

Google Feeds API昨天关闭了。另一种选择是to use Superfeedr