Ajax Updates |
| Posted: 24 Dec 2009 01:09 PM PST Google announced the Google AJAX Feed API. This is a pretty cool thing as it facilitates feed mashups by providing the server component. This means that developers can easily mash feeds on the client by simply including Google’s new API script. And Google has provided a nice Developer’s Guide which shows how to get started. Update: On May 8th, Google announced the Feed Control. As a result, this plugin has been updated (and simplified!) to use the new Google control. This page demonstrates the plugin by converting the markup displayed below into the feed content displayed in the sidebar to the right. <div id="feeds"> <a class="feed" href="http://jquery.com/blog/feed/">jQuery Blog</a> <a class="feed" href="http://www.learningjquery.com/feed/">Learning jQuery</a> </div> Using the Google API, each anchor is converted to a series of semantic < div > elements which can be styled to your liking using CSS. The CSS structure of the generated markup is detailed here: http://code.google.com/apis/ajaxfeeds/documentation/reference.html The following script is included in the head of this document: <!-- include Google Feed API --> <script type="text/javascript" src="http://www.google.com/jsapi?key=[your API key]"></script> <!-- include this plugin --> <script type="text/javascript" src="jquery.gfeed.js"></script> <script type="text/javascript"> // when the DOM is ready, convert the feed anchors into feed content $(document).ready(function() { $('a.feed').gFeed( { target: '#feeds', tabs: true } ); }); </script> Options target Using the options argument we can limit each feed to only 3 items like this: $(document).ready(function() { $('a.feed').gFeed( { max: 3 } ); }); Manually Adding a Feed $(document).ready(function() { // add a feed manually $('#alistapart').gFeed({ url: 'http://www.alistapart.com/feed/rss.xml', title: 'A List Apart Feed (Added by Brute Force)' }); }); ![]() Related Listings:
|
| You are subscribed to email updates from Ajax Updates To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google Inc., 20 West Kinzie, Chicago IL USA 60610 | |


0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.