I am using Google feed API to load rss in my website.
The Procedure mentioned in https://developers.google.com/feed/v1/devguide Works Well for fetching rss from a link.
var feed = new google.feeds.Feed("https://stackoverflow.com/feeds");
//other Codes
google.setOnLoadCallback(myFunction);
My scenario is to load multiple rss feed in my website for Dynamic Links
For example at an instance if links are as follows:
- http://www.codeplex.com/site/feeds/rss
- https://stackoverflow.com/feeds
- http://fastpshb.appspot.com/feed/1/fastpshb/rss
now I tried to fetch Rss for multiple dynamic link.
$('li').each(function(index, value)
{
var text = $(this).text();
var feed = new google.feeds.Feed(text);
});
//Other Codes
google.setOnLoadCallback(myFunction);
Only the Last Link’s rss is fetched.
On this link https://developers.google.com/feed/v1/reference#resultFind
it is mentioned that
.setOnLoadCallback(callback) is a static function that registers the specified handler function to be called once the page containing this call loads, where callback is a required function called when the containing document is loaded and the API is ready for use (e.g., after onLoad).
Is that the reason .setOnLoadCallback execute the last link?
What is the solution to this problem?
I am not sure if it is good to answer my own question.
I have got the solution for this. I am not deleting this post because if someone fetch same problem in future, this solution can help them.
http://groups.google.com/group/google-ajax-search-api/browse_thread/thread/5a8fe4073f186b53/f33186dce7229905