我一直在使用 Google Feed API 加载 RSS feed,但 Google 似乎已关闭该 API。例如,当我尝试加载纽约时报 RSS feed http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&q=http%3A%2F%2Frss .nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FHomePage.xml
,我得到以下响应:
{"responseData": null, "responseDetails": "This API is no longer available.", "responseStatus": 403}
有可行的替代方案吗?
最佳答案
使用雅虎的 YQL API :
select * from xml where url = 'https://news.ycombinator.com/rss'
您可以通过向网址添加 callback
参数来请求 JSONP feed
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20%3D%20'https%3A%2F%2Fnews.ycombinator.com%2Frss'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=mycallback
关于javascript - 使用 AJAX 加载 RSS 提要 : alternatives to Google Feed API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34049813/