multiple feed in one website using Google API for dynamic rss links
google.load("feeds", "1");
function initialize() {
var feedUrl="http://timesofindia.feedsportal.com/c/33039/f/533965/index.rss";
var feed = new google.feeds.Feed(feedUrl);
var rssoutput="";
feed.setNumEntries(3);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed1");
rssoutput+="
";
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
rssoutput+="
}
}
});
var feedUrl="http://www.thehindu.com/?service=rss";
var feed = new google.feeds.Feed(feedUrl);
feed.setNumEntries(2);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
rssoutput+="
";
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
rssoutput+="
}
container.innerHTML=rssoutput
}
});
}
google.setOnLoadCallback(initialize);
google.load("feeds", "1");
function initialize() {
var feedUrl="http://timesofindia.feedsportal.com/c/33039/f/533965/index.rss";
var feed = new google.feeds.Feed(feedUrl);
var rssoutput="";
feed.setNumEntries(3);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed1");
rssoutput+="
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
rssoutput+="
" + entry.title + "
"
rssoutput+=""+ new Date(entry.publishedDate) +"
"
rssoutput+=""+ entry.contentSnippet +"
"
rssoutput+=""+entry.content+"
""
rssoutput+=""+ new Date(entry.publishedDate) +"
"
rssoutput+=""+ entry.contentSnippet +"
"
rssoutput+=""+entry.content+"
}
}
});
var feedUrl="http://www.thehindu.com/?service=rss";
var feed = new google.feeds.Feed(feedUrl);
feed.setNumEntries(2);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
rssoutput+="
";
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
rssoutput+="
" + entry.title + "
"
rssoutput+=""+ new Date(entry.publishedDate) +"
"
rssoutput+=""+ entry.contentSnippet +"
"
rssoutput+=""+entry.content+"
""
rssoutput+=""+ new Date(entry.publishedDate) +"
"
rssoutput+=""+ entry.contentSnippet +"
"
rssoutput+=""+entry.content+"
}
container.innerHTML=rssoutput
}
});
}
google.setOnLoadCallback(initialize);
No comments:
Post a Comment