2017-01-15 45 views
4

我用谷歌订阅API寻找RSS特殊的关键字或网站,现在这个API弃用的饲料,所以我需要另一种方法查找网站的RSS,我谷歌,但我找不到什么好的办法..Google feed api已弃用,我如何才能找到rss feed的网站?

查找RSS解析HTML网站对我来说并不好,因为我想从它的任何子域名中找到所有的RSS。

例如,在过去,当使用谷歌API饲料我给ieee.org,并得到所有的RSS,如:

http://www.ieee.org/rss/index.html?feedId=News_Release

http://spectrum.ieee.org/rss/fulltext

http://spectrum.ieee.org/rss/blog/automaton/fulltext

和....

那么,有没有任何API或服务,我可以找到所有的RSS网站的饲料?

回答

0

您可以使用rss2json API获取与Google Feed API相同的Feed数据。

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; 
} 
+0

坦为尽力帮助我,但我需要的RSS网址取景器不是RSS到JSON方法.. !!请再读一遍我的问题! –