var feedcontainer=document.getElementById("feeddiv")
var feedurl="http://example.com"
var feedlimit=5
var rssoutput="<b>Latest Slashdot News:</b><br /><ul>"
function rssfeedsetup(){
var feedpointer=new google.feeds.Feed(feedurl) //Google Feed API method
feedpointer.setNumEntries(feedlimit) //Google Feed API method
feedpointer.load(displayfeed) //Google Feed API method
}
function displayfeed(result){
if (!result.error){
var thefeeds=result.feed.entries
for (var i=0; i<thefeeds.length; i++)
rssoutput+="<li><a href='" + thefeeds[i].link + "'>" + thefeeds[i].title + "</a></li>"
rssoutput+="</ul>"
feedcontainer.innerHTML=rssoutput
}
else
alert("Error fetching feeds!")
}
window.onload=function(){
rssfeedsetup()
}
我从教程中获取的这段代码,但它只获取了 Google 文档中指定的项目,即链接和标题等基础知识。
在我的 rss 提要中,我有一个标签,它位于 Is it possible to get at that?