Google feed api deprecated, How can i find rss feed of web site? [closed]

主宰稳场 提交于 2019-12-04 09:08:55

Feedly's API could fit your requirements. See https://developer.feedly.com/v3/search/

Pass the site's domain name as query parameter and you'll get rss feed matches: https://cloud.feedly.com/v3/search/feeds/?query=ieee.org

You can use rss2json API to get feed data same as google feed API did.

var url = "http://www.espncricinfo.com/rss/content/feeds/news/8.xml"; //feed url
var xhr = createCORSRequest("GET","https://api.rss2json.com/v1/api.json?rss_url="+url);
if (!xhr) {
  throw new Error('CORS not supported');
} else {
    xhr.send();
}
xhr.onreadystatechange = function() {
    if (xhr.readyState==4 && xhr.status==200) {
        var responseText = xhr.responseText;
        var result = JSON.parse(responseText);
        console.log(result);
    }
}
function createCORSRequest(method, url) {
    var xhr = new XMLHttpRequest();
    if ("withCredentials" in xhr) {
        xhr.open(method, url, true);
    } else if (typeof XDomainRequest != "undefined") {
        xhr = new XDomainRequest();
        xhr.open(method, url);
    } else {
        xhr = null;
    }
    return xhr;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!