<?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>Dasha Salo&#039;s Blog</title>
	<atom:link href="http://dashasalo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dashasalo.com</link>
	<description></description>
	<lastBuildDate>Mon, 09 Jan 2012 17:14:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>RaphaelJS 2: Drag end position</title>
		<link>http://dashasalo.com/2012/01/09/raphaeljs-2-drag-end-posiion/</link>
		<comments>http://dashasalo.com/2012/01/09/raphaeljs-2-drag-end-posiion/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 17:13:39 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[RaphaelJS]]></category>
		<category><![CDATA[Drag and drop]]></category>
		<category><![CDATA[end position]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1666</guid>
		<description><![CDATA[There seems to be a difference between how RaphaelJS 1 and 2 treat drag and drop end position. In version 1 calling getBBox().x would return new horizontal location of the object. In version 2 it&#8217;s not the case &#8211; it returns original coordinates. To get new coordinates use attr method instead: this.attr('x'); this.attr('y');]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>There seems to be a difference between how <a href="raphaeljs.com">RaphaelJS 1 and 2</a> treat drag and drop end position.</p>
<p>In version 1 calling getBBox().x would return new horizontal location of the object. In version 2 it&#8217;s not the case &#8211; it returns original coordinates.</p>
<p>To get new coordinates use attr method instead:</p>
<pre class="brush: js">
this.attr('x');
this.attr('y');
</pre>
<div class="shr-publisher-1666"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2012/01/09/raphaeljs-2-drag-end-posiion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple jQuery Content Slider</title>
		<link>http://dashasalo.com/2011/12/10/simple-jquery-content-slider/</link>
		<comments>http://dashasalo.com/2011/12/10/simple-jquery-content-slider/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 11:14:10 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slider]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1657</guid>
		<description><![CDATA[You can try it out and look through code on jsFiddle.net.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>You can try it out and look through code on <a href="http://jsfiddle.net/dashasalo/nBHp6/" target="_blank">jsFiddle.net</a>.</p>
<p style="text-align:center"><a href="http://jsfiddle.net/dashasalo/nBHp6/" target="_blank"><img src="http://dashasalo.com/files/2011/12/Screen-shot-2011-12-10-at-11.07.18.png" alt="Simple jQuery content slider" style="width:100%"></a></p>
<iframe class="iframe-class" width="100%" height="300" src="http://jsfiddle.net/dashasalo/nBHp6/embedded/" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" allowtransparency="true"></iframe>
<div class="shr-publisher-1657"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/12/10/simple-jquery-content-slider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iFrame reloads when shown after being hidden in Firefox</title>
		<link>http://dashasalo.com/2011/12/01/iframe-reloads-when-shown-after-being-hidden-in-firefox/</link>
		<comments>http://dashasalo.com/2011/12/01/iframe-reloads-when-shown-after-being-hidden-in-firefox/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 16:51:29 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[reload]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1613</guid>
		<description><![CDATA[This might be a bug or a feature (I am not sure) but if you hide an iframe and then show it again then it causes iframe to reload in FireFox. $('#myIframe').css('display', 'none'); // some code ... $('#myIframe').css('display', 'block'); The solution is to use visibility instead of display: $('#myIframe').css('visibility', 'hidden'); // some code ... $('#myIframe').css('visibility', [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>This might be a bug or a feature (I am not sure) but if you hide an iframe and then show it again then it causes iframe to reload in FireFox.</p>
<pre class="brush: js">
$('#myIframe').css('display', 'none');

// some code ...

$('#myIframe').css('display', 'block');
</pre>
<p>The solution is to use <strong>visibility</strong> instead of <strong>display</strong>:</p>
<pre class="brush: js">
$('#myIframe').css('visibility', 'hidden');

// some code ...

$('#myIframe').css('visibility', 'visible');
</pre>
<div class="shr-publisher-1613"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/12/01/iframe-reloads-when-shown-after-being-hidden-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YouTube hide videos search</title>
		<link>http://dashasalo.com/2011/11/30/youtube-hide-videos-search/</link>
		<comments>http://dashasalo.com/2011/11/30/youtube-hide-videos-search/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 23:10:14 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[hide relative videos]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1618</guid>
		<description><![CDATA[Took me some time to find this so here it is: rel=0 Just add this parameter to the video url&#8230;]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p style="text-align:center"><img style="width: 400px" src="http://dashasalo.com/files/2011/11/Screen-shot-2011-11-30-at-23.06.55.png"></p>
<p>Took me some time to find this so here it is:</p>
<p><strong>rel=0</strong></p>
<p>Just add this parameter to the video url&#8230;</p>
<div class="shr-publisher-1618"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/11/30/youtube-hide-videos-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Links in iOS web app open in new window</title>
		<link>http://dashasalo.com/2011/11/30/links-in-ios-web-app-open-in-new-window/</link>
		<comments>http://dashasalo.com/2011/11/30/links-in-ios-web-app-open-in-new-window/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 22:58:58 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone web app]]></category>
		<category><![CDATA[new window]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1632</guid>
		<description><![CDATA[If you have ever tried creating a web app from your website (saving to Home Screen) with iPhone or iPad then you have probably noticed that all the links in your webapp open in the new Safari window. The issue is explained and solved in this StackOverflow question. I thought it&#8217;s also a good idea [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>If you have ever tried creating a web app from your website (saving to Home Screen) with iPhone or iPad then you have probably noticed that all the links in your webapp open in the new Safari window.</p>
<p>The issue is explained and solved in <a href="http://stackoverflow.com/questions/2898740/iphone-safari-web-app-opens-links-in-new-window">this StackOverflow question</a>.</p>
<p>I thought it&#8217;s also a good idea to check that we are actually inside the iOS app before running the code:</p>
<pre class="brush: js">
if (window.navigator &#038;&#038; window.navigator.standalone) {
    var a = document.getElementsByTagName("a");
    for (var i = 0; i < a.length; i++) {
        a[i].onclick = function() {
            window.location = this.getAttribute("href");
            return false;
        };
    }
}
</pre>
<div class="shr-publisher-1632"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/11/30/links-in-ios-web-app-open-in-new-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RaphaelJS rectangle shadow</title>
		<link>http://dashasalo.com/2011/11/30/raphaeljs-rectangle-shadow/</link>
		<comments>http://dashasalo.com/2011/11/30/raphaeljs-rectangle-shadow/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 22:39:19 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[RaphaelJS]]></category>
		<category><![CDATA[rectangle]]></category>
		<category><![CDATA[round corners]]></category>
		<category><![CDATA[shadow]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1619</guid>
		<description><![CDATA[I had to create a very basic shadow for a rectangle with rounded corners using RaphaelJS. Like this: I used a shadow plugin from http://www.redbeard-tech.com for rectangles before but unfortunately it doesn&#8217;t work for rounded corners. So here is my extension to the plugin that solves rounded corners issue and adds a remove shadow functionality. [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I had to create a very basic shadow for a rectangle with rounded corners using <a href="raphaeljs.com">RaphaelJS</a>. Like this:</p>
<p style="text-align:center"><img src="http://dashasalo.com/files/2011/11/Screen-shot-2011-11-30-at-21.59.32.png"></p>
<p>I used a shadow plugin from <a href="http://www.redbeard-tech.com">http://www.redbeard-tech.com</a> for rectangles before but unfortunately it doesn&#8217;t work for rounded corners. So here is my extension to the plugin that solves rounded corners issue and adds a remove shadow functionality.</p>
<pre class="brush: js">
Raphael.el.shadow = function (x_offset, y_offset, size, color, radius) {
    if (typeof(this.shadowSet) == 'undefined') {
        this.shadowSet = this.paper.set();
    } else {
        while (this.shadowSet.length > 0) { this.shadowSet.pop().remove(); }
    }
    var width = this.attr('width'),
        height = this.attr('height'),
        left = this.attr('x'),
        top = this.attr('y');

    radius = radius + 8;
    for (i = size; i > 0; i--) {
        this.shadowSet.push(
            this.paper.rect(left - i + x_offset, top - i + y_offset, width + i*2, height + i*2, radius).attr({fill: color, stroke: 'none', opacity: 0.1 + i*0.02})
        );
    }

    this.onAnimation(function() {
        if (!this.hideShadow)
        {
    	    this.shadow(x_offset, y_offset, size, color, radius);
        }
    });

    this.removeShadow = function() {
        for (var i = 0; i < this.shadowSet.length; i++) {
            if (this.shadowSet[i]) {
                this.shadowSet[i].remove();
            }
        }
        this.hideShadow = true;
    };

    return this.shadowSet.insertBefore(this);
};
</pre>
<p>To apply the shadow to RaphaelJS object:</p>
<pre class="brush: js">
advertHolder.shadow(0, 0, 7, "#111", 10);
</pre>
<p>I can be used as a stand-alone extension to RaphaelJS (for rectangles only) or as an addition to the original plugin by copying and pasting the relevant code.</p>
<div class="shr-publisher-1619"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/11/30/raphaeljs-rectangle-shadow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>fb:comments iframe height</title>
		<link>http://dashasalo.com/2011/11/07/fbcomments-iframe-height/</link>
		<comments>http://dashasalo.com/2011/11/07/fbcomments-iframe-height/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 22:58:23 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook fb:comments gap iframe]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1583</guid>
		<description><![CDATA[You can see the problem on the image below &#8211; the gap between the Facebook comments widget and the rest of the page is too big. The reason for this is that Facebook explicitly sets the hight of iframe to 200px and increases it when new comment is added. Surprisingly if the comment was deleted [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>You can see the problem on the image below &#8211; the gap between the Facebook comments widget and the rest of the page is too big.</p>
<p style="text-align: center; border: 10px solid #eee"><img src="http://dashasalo.com/files/2011/11/Screen-shot-2011-11-07-at-20.32.34.png"></p>
<p>The reason for this is that Facebook explicitly sets the hight of iframe to 200px and increases it when new comment is added. Surprisingly if the comment was deleted the height stays the same as it was originally&#8230;</p>
<p>The best solution I could come up with was to get number of comments from Facebook as a separate fbml tag, parse it in javascript and then reduce the gap accordingly.</p>
<p>Here is my solution in action:</p>
<iframe class="iframe-class" width="100%" height="300" src="http://dashasalo.com/wp-content/uploads/fbcomment/fbcomment2.html" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" allowtransparency="true"></iframe>
<p>And this is the code:</p>
<pre class="brush: js">
var commentsCount = 0;

var resizeIframe = function(){
	if ((commentsCount == 0) &#038;&#038; ($('.fbcomments iframe').height() > 200)) return false;

	switch (commentsCount)
	{
		case 0: $('.social').css('margin-bottom', '-100px'); break;
		case 1: $('.social').css('margin-bottom', '-30px'); break;
		default: $('.social').css('margin-bottom', '-10px');
	}
};

$(document).ready(function(){
	var e = document.createElement('script');
	e.src = 'http://connect.facebook.net/en_US/all.js#appId=XXXXXXXXXXXXX&amp;xfbml=1';
	document.body.appendChild(e);

	window.fbAsyncInit = function() {
	       FB.init({status: true, cookie: true, xfbml: true});
	       FB.Event.subscribe("xfbml.render", function() {
	            setTimeout('resizeIframe()', 1000);
		    commentsCount = parseInt($('.fb-comments-count').text());

		    FB.Event.subscribe("comment.create", function() { commentsCount++; resizeIframe();});
	            FB.Event.subscribe("comment.remove", function() {
				commentsCount--;
				if ($('.fbcomments iframe').height() - 63 < 200) {
					$('.fbcomments iframe').height(200);
				} else {
					$('.fbcomments iframe').height($('.fbcomments iframe').height() - 63);
				}
				resizeIframe();
                	});
		});
	};
});
</pre>
<pre class="brush: html">
&lt;!DOCTYPE html&gt;

&lt;html lang="en" xmlns:fb="https://www.facebook.com/2008/fbml"&gt;
&lt;head&gt;
	&lt;meta charset="utf-8"&gt;
	&lt;title&gt;untitled&lt;/title&gt;
	&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"&gt;&lt;/script&gt;
	&lt;style&gt;
		.fbcomments iframe {position:relative; z-index:100;}
	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id="fb-root"&gt;&lt;/div&gt;

	&lt;a style="display: none" href="http://dashasalo.com" class="fb-comments-count"&gt;0&lt;/a&gt;

	&lt;div class="social"&gt;
		&lt;div class="fbcomments" id="fbcomments"&gt;
			&lt;fb:comments href="http://dashasalo.com" num_posts="3" width="500"&gt;&lt;/fb:comments&gt;
		&lt;/div&gt;
	&lt;/div&gt;

	&lt;p&gt;The current situation where we are today, there’s a clear distinction between the Open Web and native APIs and how things have to be built. As many developers are aware of, we need consistent APIs across web browsers, operating systems and devices to be able to build something for the world, not just a specific device or vendor. We need a way to take the web to the next step. What is WebAPI?&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<div class="shr-publisher-1583"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/11/07/fbcomments-iframe-height/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Istanbul, Turkey</title>
		<link>http://dashasalo.com/2011/10/04/istanbul-turkey/</link>
		<comments>http://dashasalo.com/2011/10/04/istanbul-turkey/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 09:13:03 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[istanbul]]></category>
		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1560</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/320766_10150333034339223_568864222_7786920_1114893994_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 20px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/316326_10150333034749223_568864222_7786931_1719979386_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 10px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/307463_10150333036734223_568864222_7786948_1438391926_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 20px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/297281_10150333036254223_568864222_7786944_1408747395_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 20px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/294141_10150333035294223_568864222_7786936_294507159_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 10px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/320286_10150333036039223_568864222_7786942_1869332757_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 10px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/294073_10150333035544223_568864222_7786938_9146517_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 10px"><img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/300731_10150333035399223_568864222_7786937_2124005083_n.jpg" style="height: 150px; border: 2px solid #444; margin-right: 10px"></p>
<div class="shr-publisher-1560"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/10/04/istanbul-turkey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New night theme</title>
		<link>http://dashasalo.com/2011/09/26/new-night-theme/</link>
		<comments>http://dashasalo.com/2011/09/26/new-night-theme/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 11:33:41 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[night theme]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1542</guid>
		<description><![CDATA[Finally found some time to create a night theme for this blog. You can see it every day after 10pm &#8211; just visit the blog. Theme is now weather aware as well. You will most probably see either a cloud (on a cloudy day) or rain drops (on a rainy day). Weather doesn&#8217;t vary much [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p style="text-align: center"><img src="http://dashasalo.com/files/2011/09/photo-2.png" alt="night theme"></p>
<p>Finally found some time to create a night theme for this blog. You can see it every day after 10pm &#8211; just visit the blog.</p>
<p>Theme is now weather aware as well. You will most probably see either a cloud (on a cloudy day) or rain drops (on a rainy day). Weather doesn&#8217;t vary much here in Newcastle <img src='http://dashasalo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>More exciting stuff to follow!</p>
<div class="shr-publisher-1542"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/09/26/new-night-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Weather API</title>
		<link>http://dashasalo.com/2011/09/22/google-weather-api/</link>
		<comments>http://dashasalo.com/2011/09/22/google-weather-api/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 10:32:08 +0000</pubDate>
		<dc:creator>dashasalo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[weather api]]></category>

		<guid isPermaLink="false">http://dashasalo.com/?p=1468</guid>
		<description><![CDATA[I have recently discovered a very simple and powerful (and seems like secret) weather service from Google. It has been covered in details in this old post by Adam DuVander. Great thing about it is that you don&#8217;t have to do much work to get the basic weather details and images &#8211; it&#8217;s all included [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I have recently discovered a very simple and powerful (and seems like secret) weather service from Google. It has been covered in details in <a href="http://www.freecomputeradvice.net/2009/08/google-weather-api.html">this old post by Adam DuVander</a>.</p>
<p>Great thing about it is that you don&#8217;t have to do much work to get the basic weather details and images &#8211; it&#8217;s all included in the returned XML. All you need to do is append your location name or post code to the url and parse the XML.</p>
<p>The simple example I used for this blog:</p>
<pre class="brush: php">
$requestAddress = "http://www.google.com/ig/api?weather=Newcastle+Upon+Tyne&#038;hl=en";

$xml_str = file_get_contents($requestAddress, 0);
$xml = new SimplexmlElement($xml_str);
</pre>
<p>XML you should get back get back looks like this: </p>
<pre class="brush: xml">
    &lt;xml_api_reply version="1"&gt;
        &lt;weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0"&gt;
            &lt;forecast_information&gt;
                &lt;city data="Newcastle Upon Tyne, Tyne And Wear"/&gt;
                &lt;postal_code data="ne46at"/&gt;
                &lt;latitude_e6 data=""/&gt;
                &lt;longitude_e6 data=""/&gt;
                &lt;forecast_date data="2011-09-22"/&gt;
                &lt;current_date_time data="2011-09-22 09:20:00 +0000"/&gt;
                &lt;unit_system data="US"/&gt;
            &lt;/forecast_information&gt;
            &lt;current_conditions&gt;
                &lt;condition data="Partly Cloudy"/&gt;
                &lt;temp_f data="55"/&gt;
                &lt;temp_c data="13"/&gt;
                &lt;humidity data="Humidity: 67%"/&gt;
                &lt;icon data="/ig/images/weather/partly_cloudy.gif"/&gt;
                &lt;wind_condition data="Wind: W at 23 mph"/&gt;
            &lt;/current_conditions&gt;
            &lt;forecast_conditions&gt;
                &lt;day_of_week data="Thu"/&gt;
                &lt;low data="50"/&gt;
                &lt;high data="57"/&gt;
                &lt;icon data="/ig/images/weather/mostly_sunny.gif"/&gt;
                &lt;condition data="Mostly Sunny"/&gt;
            &lt;/forecast_conditions&gt;
            &lt;forecast_conditions&gt;
                &lt;day_of_week data="Fri"/&gt;
                &lt;low data="48"/&gt;
                &lt;high data="61"/&gt;
                &lt;icon data="/ig/images/weather/chance_of_rain.gif"/&gt;
                &lt;condition data="Chance of Rain"/&gt;
            &lt;/forecast_conditions&gt;
            &lt;forecast_conditions&gt;
                &lt;day_of_week data="Sat"/&gt;
                &lt;low data="52"/&gt;
                &lt;high data="61"/&gt;
                &lt;icon data="/ig/images/weather/mostly_sunny.gif"/&gt;
                &lt;condition data="Mostly Sunny"/&gt;
            &lt;/forecast_conditions&gt;
            &lt;forecast_conditions&gt;
                &lt;day_of_week data="Sun"/&gt;
                &lt;low data="55"/&gt;
                &lt;high data="64"/&gt;
                &lt;icon data="/ig/images/weather/mostly_sunny.gif"/&gt;
                &lt;condition data="Partly Sunny"/&gt;
            &lt;/forecast_conditions&gt;
        &lt;/weather&gt;
    &lt;/xml_api_reply&gt;
</pre>
<p>To get the particular node use SimpleXML syntax. For example, to get current weather condition:</p>
<pre class="brush: php">
$weather = $xml->weather->current_conditions->condition['data'];
</pre>
<p>List of conditions can be found in <a href="http://stackoverflow.com/questions/1563884/google-weather-api-conditions">this StackOverflow question feed</a>. But as there is no official documentation from Google the list might be incomplete. </p>
<div class="shr-publisher-1468"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://dashasalo.com/2011/09/22/google-weather-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

