问题
I used Google Feed API for finding rss feeds of special keywords or websites, now this api deprecated, so i need alternative way for finding rss of website, I google it but i cannot find any good way..
Find rss from parsing html of website is not good for me because i want to find all rss from any subdomains of it.
For example in the past when with using Google Feed API i give ieee.org and get all rss like:
http://www.ieee.org/rss/index.html?feedId=News_Release
http://spectrum.ieee.org/rss/fulltext
http://spectrum.ieee.org/rss/blog/automaton/fulltext
and ....
So, Is there any api or services that i can find all of rss feeds of website?
回答1:
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
回答2:
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;
}
来源:https://stackoverflow.com/questions/41661420/google-feed-api-deprecated-how-can-i-find-rss-feed-of-web-site