Feeds integration
Jump to navigation
Jump to search
Feeds integration[edit]
Possible solutions[edit]
Google AJAX API[edit]
Cons/Pros[edit]
Pros:[edit]
- Very simple to implement and to reuse.
Cons:[edit]
- Google Terms of use : [1]
How to[edit]
To use the Google AJAX API please copy the following code on the jsp page:
<script src="http://www.google.com/jsapi"> </script>
<script>
google.load("feeds", "1");
function facesBlogInitialize()
{
var feedControl = new google.feeds.FeedControl();
feedControl.addFeed("http://url/of/the/feed/", "Feed name");
feedControl.setNumEntries(6);
feedControl.draw(document.getElementById("feedControl"));
}
google.setOnLoadCallback(facesBlogInitialize);
</script>
Remarks:[edit]
- The first script element should not be minimized. To avoid the auto-minimization from JSF please write like it is on the previous code.
- The url of the feed should be access from a backing bean with either
<h:outputText value="#{MyBackingBean.feedUrl}"/>
or replace the url with
document.getElementById("rssFeedUrl").value
and add in your jsp
<h:inputHidden id="rssFeedUrl" value="#{BlogBean.rssFeedUrl}"></h:inputHidden>