
google.load("feeds","1")
function rssdisplayer(divid,url,feedlimit,showoptions){this.showoptions=showoptions||""
var feedpointer=new google.feeds.Feed(url)
feedpointer.setNumEntries(feedlimit)
document.write('<div id="'+divid+'">Loading feed...</div>')
this.feedcontainer=document.getElementById(divid)
var displayer=this
feedpointer.load(function(r){displayer.formatoutput(r)})}
rssdisplayer.prototype.formatdate=function(datestr){var itemdate=new Date(datestr)
return"<span style='color:gray; font-size: 90%'>"+itemdate.toLocaleString()+"</span>"}
rssdisplayer.prototype.formatoutput=function(result){if(!result.error){var thefeeds=result.feed.entries
var rssoutput=""
for(var i=0;i<thefeeds.length;i++){var itemtitle="<b>"+thefeeds[i].title+"</b>"
var itemdate=/date/i.test(this.showoptions)?this.formatdate(thefeeds[i].publishedDate):""
var itemdescription=/description/i.test(this.showoptions)?"<br />"+thefeeds[i].content:/snippet/i.test(this.showoptions)?"<br />"+thefeeds[i].contentSnippet:""
var itemdescription_mod=itemdescription.slice(29,99999)
var itemdescription_mod="<br /><font size=\"2\"><i>"+itemdescription_mod+"</i></font>"
rssoutput+=itemtitle+" "+itemdate+itemdescription_mod}
this.feedcontainer.innerHTML=rssoutput}
else
alert("Error fetching feeds: "+result.error.message)}