Feeds integration

From MPDLMediaWiki
Jump to navigation Jump to search

Possible solutions[edit]

Google AJAX API[edit]


  • Very simple to implement and to reuse.


  • Google Terms of use : [1]

How to[edit]

To use the Google AJAX API, just reuse the following code and adapt the red parts with your configuration:

<script src="http://www.google.com/jsapi">&#160;</script> 
  google.load("feeds", "1");
  function initialize() 
      var feedControl = new google.feeds.FeedControl();
      feedControl.addFeed("http://url/of/the/feed/ ", "Feed name");


  • 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


and add in your jsp

 <h:inputHidden id="rssFeedUrl" value="#{MyBackingBean.rssFeedUrl}"></h:inputHidden>

  • The Google AJAX Feed API might be used with a Google AJAX key [2]. This key is defined for one server (that means one key is needed for dev, qa, demo, live, ..., servers). The usefulness of that key is described here [3]. If you want to use it, add it as parameter in the url source of the first script

 <script src="http://www.google.com/jsapi?key=your-key">&#160;</script> 

  • You can easily add additional feeds to your feedControl:

 feedControl.addFeed("http://url/of/second/feed/", "Second Feed name");
 feedControl.addFeed("http://url/of/third/feed/", "ThirdFeed name");

  • To set the target of the links, add:

 feedControl.setLinkTarget(google.feeds.LINK_TARGET_BLANK | google.feeds.LINK_TARGET_SELF | google.feeds.LINK_TARGET_TOP | google.feeds.LINK_TARGET_PARENT);