<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>[Dot] Code Dump &#187; AJAX</title>
	<atom:link href="http://www.dotcodedump.com/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotcodedump.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 06 Jan 2010 12:27:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a simple Twitter AJAX widget using Google Feeds API</title>
		<link>http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/</link>
		<comments>http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 05:32:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://blog.lintnernet.com/?p=47</guid>
		<description><![CDATA[I was doing some research into making API calls to Twitter using JavaScript.  The one problem I ran into was calling remote domains.  One quick solution I found was to use the Google Feed API. Google provides a really easy and simple interface for accessing feeds via JavaScript.
A quick how to:
To start out [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing some research into making API calls to <a href="http://twitter.com/ianlintner">Twitter</a> using JavaScript.  The one problem I ran into was calling remote domains.  One quick solution I found was to use the Google Feed API. Google provides a really easy and simple interface for accessing feeds via JavaScript.</p>
<p><span style="font-weight: bold;">A quick how to</span>:</p>
<p>To start out you must import the api using your <a href="http://code.google.com/apis/maps/signup.html">Google API key</a>.
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>&lt;script src="http://www.google.com/jsapi?key=[Your Google API Key]"&gt;&lt;/script&gt;</code></pre>
<p>This is script was taking from the <a href="http://code.google.com/apis/ajax/playground/#load_feed">Google AJAX API Playground</a>, I just added in the call for Twitter, the full script is below.</p>
<p>First the Google feed object is instantiated with the call to the <a href="http://apiwiki.twitter.com/REST+API+Documentation">Twitter API</a> via RSS.
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>var feed = new google.feeds.Feed("http://twitter.com/statuses/user_timeline/ianlintner.rss");</code></pre>
<p>The Google feed API is great way to access and work with remote feeds, and APIs using just JavaScript.  This also an asynchronous call, so it should play well with other AJAX solutions.</p>
<p>The full listing, with my changes.
<pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"><code>&lt;!--Copyright (c) 2008 Google Inc.

You are free to copy and use this sample.License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license--&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head&gt;&lt;meta http-equiv="content-type" content="text/html; charset=utf-8"/&gt;&lt;title&gt;Google AJAX Search API Sample&lt;/title&gt;&lt;script src="http://www.google.com/jsapi?key=[Google Key]"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;/**  How to load a feed via the Feeds API.*/

google.load("feeds", "1");

// Our callback function, for when a feed is loaded.function feedLoaded(result) {  if (!result.error) {    // Grab the container we will put the results into    var container = document.getElementById("content");    container.innerHTML = '';

    // Loop through the feeds, putting the titles onto the page.    // Check out the result object for a list of properties returned in each entry.    // http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON    for (var i = 0; i &lt; result.feed.entries.length; i++) {      var entry = result.feed.entries[i];      var div = document.createElement("div");      div.appendChild(document.createTextNode(entry.title));      container.appendChild(div);    }  }}

function OnLoad() {  // Create a feed instance that will grab twitter  var feed = new google.feeds.Feed("http://twitter.com/statuses/user_timeline/ianlintner.rss");

  // Calling load sends the request off.  It requires a callback function.  feed.load(feedLoaded);}

google.setOnLoadCallback(OnLoad);&lt;/script&gt;&lt;/head&gt;&lt;body style="font-family: Arial;border: 0 none;"&gt;&lt;div id="content"&gt;Loading...&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</code></pre>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API&amp;url=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/&amp;title=Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Creating+a+simple+Twitter+AJAX+widget+using+Google+Feeds+API+@+http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.dotcodedump.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.dotcodedump.com/2009/02/creating-a-simple-twitter-ajax-widget-using-google-feeds-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
