<?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>Clain Dsilva&#039;s Blog</title>
	<atom:link href="http://www.claindsilva.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.claindsilva.com</link>
	<description>Taking Web To The Heart</description>
	<lastBuildDate>Mon, 18 Feb 2013 06:27:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How To Cross Fade Anything With JavaScript [JavaScript Fade Effect]</title>
		<link>http://www.claindsilva.com/javascript/how-to-cross-fade-anything-with-javascript-javascript-fade-effect/</link>
		<comments>http://www.claindsilva.com/javascript/how-to-cross-fade-anything-with-javascript-javascript-fade-effect/#comments</comments>
		<pubDate>Sun, 11 Nov 2012 12:59:13 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Crossfade]]></category>
		<category><![CDATA[crossfade effect]]></category>
		<category><![CDATA[Crossfade HTML elements]]></category>
		<category><![CDATA[CSS crossfade]]></category>
		<category><![CDATA[javascript Crossfade]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=229</guid>
		<description><![CDATA[<p>This is one sure question that every budding web developer would have in his mind.  Today I am going to explain how to achieve  cross fade effect using JavaScript and CSS opacity property. As always lets use pure 100% home grown JavaScript. No frameworks are used.</p> <p>Demo</p> <p>The HTML</p> <p>Its necessary for the element to [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.claindsilva.com/wp-content/uploads/2012/11/Javascript-Cross-Fade.png" alt="JavaScript Cross Fade" title="JavaScript Cross Fade" width="281" height="191" class="alignleft size-full wp-image-232" />This is one sure question that every budding web developer would have in his mind.  Today I am going to explain how to achieve  cross fade effect using JavaScript and CSS opacity property. As always lets use pure 100% home grown JavaScript. No frameworks are used.</p>
<p><strong>Demo</strong></p>
<div style="border-radius:15px; padding:10px; background:#000000;width:550px">
<iframe src="http://www.claindsilva.com/demo/crossfade"  frameborder="0" scrolling="no" style="height:150px;width:550px;"></iframe>
</div>
<p><strong>The HTML</strong></p>
<p>Its necessary for the element to have an id to identify for the cross fade function.</p>
<blockquote><p>&lt;div <span style="color: #3366ff;">id=&#8221;myElement&#8221;</span>&gt;This text will toggle fade effects &lt;/div&gt;</p></blockquote>
<p><strong>The JavaScript</strong></p>
<blockquote><p>function fadeOut(id,val){<br />
if(isNaN(val)){ val = 9;}<br />
document.getElementById(id).style.opacity=&#8217;0.&#8217;+val;<br />
//For IE<br />
document.getElementById(id).style.filter=&#8217;alpha(opacity=&#8217;+val+&#8217;0)&#8217;;<br />
if(val&gt;0){<br />
val&#8211;;<br />
setTimeout(&#8216;fadeOut(&#8220;&#8216;+id+&#8217;&#8221;,&#8217;+val+&#8217;)',90);<br />
}else{return;}<br />
}</p>
<p>function fadeIn(id,val){<br />
if(isNaN(val)){ val = 0;}<br />
document.getElementById(id).style.opacity=&#8217;0.&#8217;+val;<br />
//For IE<br />
document.getElementById(id).style.filter=&#8217;alpha(opacity=&#8217;+val+&#8217;0)&#8217;;<br />
if(val&lt;9){<br />
val++;<br />
setTimeout(&#8216;fadeIn(&#8220;&#8216;+id+&#8217;&#8221;,&#8217;+val+&#8217;)',90);<br />
}else{return;}<br />
}</p></blockquote>
<p>You might have noticed two functions <strong>fadeOut</strong> and <strong>fadeIn</strong>. The function names define what they do.</p>
<p><strong>The Concept</strong></p>
<p>CSS opacity property of the element to be faded is increased / decreased using JavaScript. To achieve the fade effect the fade functions are recursively called while introducing a time delay with native JavaScript <strong>setTimeout</strong> function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/javascript/how-to-cross-fade-anything-with-javascript-javascript-fade-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pure CSS Sticky Elements, Sticky Footer, Sticky Banner, Sticky Margin widgets</title>
		<link>http://www.claindsilva.com/css/pure-css-sticky-elements-sticky-footer-sticky-banner-sticky-margin-widgets/</link>
		<comments>http://www.claindsilva.com/css/pure-css-sticky-elements-sticky-footer-sticky-banner-sticky-margin-widgets/#comments</comments>
		<pubDate>Sat, 10 Nov 2012 03:03:54 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css 3 sticky elements]]></category>
		<category><![CDATA[css floating elements]]></category>
		<category><![CDATA[css sticky elements]]></category>
		<category><![CDATA[HTML sticky elemenets]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=220</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/11/Pure-CSS-Sticky-Elements.png"></a>Ever wonder how those sticky footer stays intact at the bottom of the page? And those lovely bubbles that floats over the page even while scrolling? fed up of trying Jquery and other scripts library available? Here is the quick and complete CSS solution to make any HTML elements sticky. Like my previous Post, [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/11/Pure-CSS-Sticky-Elements.png"><img class="alignleft size-medium wp-image-225" title="Pure CSS Sticky Elements" src="http://www.claindsilva.com/wp-content/uploads/2012/11/Pure-CSS-Sticky-Elements-300x146.png" alt="Pure CSS Sticky Elements" width="300" height="146" /></a>Ever wonder how those sticky footer stays intact at the bottom of the page? And those lovely bubbles that floats over the page even while scrolling? fed up of trying Jquery and other scripts library available? Here is the quick and complete CSS solution to make any HTML elements sticky. Like my previous Post, all the codes are pure 100% home made CSS.. that means no CSS/ JavaScript library is used.</p>
<p>Lets get Started</p>
<p><a style="color: #ff6600;" title="Pure CSS Sticky Elements" href="http://www.claindsilva.com/demo/StickyCssElements/" target="_blank" rel="noindex, nofollow"><strong>Demo</strong></a> <strong><a style="color: #ff6600;" href="http://www.claindsilva.com/demo/StickyCssElements/sticky elements with css.zip" rel="noindex, nofollow">Download Code</a></strong></p>
<p><strong>The HTML</strong></p>
<p>We are making 4 sticky HTML elements Sticky buble,  Sticky left margin banner, Sticky footer, Sticky page center like a light box</p>
<blockquote><p>&lt;div id=&#8221;sticky-buble&#8221; &gt;Sticky&lt;br /&gt;Buble&lt;/div&gt;<br />
&lt;div id=&#8221;sticky-Left-Banner&#8221; &gt;Left Margin&lt;br /&gt;Sticky&lt;/div&gt;<br />
&lt;div id=&#8221;sticky-center&#8221; &gt;Stickey Page Center &lt;br /&gt;With Transparency&lt;/div&gt;<br />
&lt;div id=&#8221;sticky-footer&#8221; &gt;Stickey Footer&lt;/div&gt;</p></blockquote>
<p><strong>The CSS</strong></p>
<p>The CSS property that makes sticky is the <strong>position: fixed </strong>, Position fixed makes the element stay fixed form the position top, left properties define. Unlike the <strong>position: absolute</strong> property it does not count the position of the element with respect to page , rather it counts the position from the visible screen and that does the trick.</p>
<p><strong>Sticky Buble</strong></p>
<blockquote><p>#sticky-buble{<br />
<span style="color: #3366ff;">position:fixed;</span><br />
<span style="color: #3366ff;"> top:400px;</span><br />
<span style="color: #3366ff;"> left:50px;</span><br />
width:130px;<br />
height:50px;<br />
color:#00CCFF;<br />
border-radius: 15px;<br />
background:#000000;<br />
}</p></blockquote>
<p><strong>Sticky Left Margin Banner</strong></p>
<blockquote><p>#sticky-Left-Banner{<br />
<span style="color: #3366ff;">position:fixed;</span><br />
<span style="color: #3366ff;">top:100px;</span><br />
<span style="color: #3366ff;">left:0px;</span><br />
height:50px;<br />
background:#000000;<br />
border-radius: 0px 10px 10px 0px;<br />
box-shadow: 2px 3px 5px #888;<br />
}</p></blockquote>
<p><strong>Sticky footer</strong></p>
<blockquote><p>#sticky-footer{<br />
<span style="color: #3366ff;">position:fixed;</span><br />
<span style="color: #3366ff;">top:95%;</span><br />
<span style="color: #3366ff;">left:5%;</span><br />
<span style="color: #3366ff;">width:90%;</span><br />
height:50px;<br />
background:#000000;<br />
border:2px solid #00CCFF;<br />
border-radius: 10px 10px 0px 0px;<br />
box-shadow: -2px -2px 15px #888;<br />
}</p></blockquote>
<p><strong>Sticky Page Center</strong></p>
<blockquote><p>#sticky-center{<br />
<span style="color: #3366ff;">position:fixed;</span><br />
<span style="color: #3366ff;"> top:30%;</span><br />
<span style="color: #3366ff;"> left:30%;</span><br />
opacity:0.9;<br />
width:500px;<br />
height:200px;<br />
background:#000000;<br />
border-radius: 15px;<br />
filter:alpha(opacity=90);<br />
box-shadow: 2px 3px 5px #888;<br />
}</p></blockquote>
<p>Hope you will enjoy this quick CSS trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/css/pure-css-sticky-elements-sticky-footer-sticky-banner-sticky-margin-widgets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pure JavaScript SlideShow</title>
		<link>http://www.claindsilva.com/javascript/pure-javascript-slideshow/</link>
		<comments>http://www.claindsilva.com/javascript/pure-javascript-slideshow/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 17:43:36 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=202</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/10/pure-javascript-slide-show.png"></a>I have been always fascinated about the slideshows, how do they make one. Well here is the basic slideshow with pure JavaScript. No frameworks are used, No chunks of codes,  Simple Slideshow with 100% pure home grown JavaScript.</p> <p><a style="color: #ff6600;" title="pure-javascript-slideshow" href="http://www.claindsilva.com/demo/pure-javascript-slideshow/" target="_blank">Demo</a> <a style="color: #ff6600;" href="http://www.claindsilva.com/demo/pure-javascript-slideshow/Javascript Slide Show.zip">Download Code</a></p> <p>Lets start with [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/10/pure-javascript-slide-show.png"><img class="alignleft  wp-image-204" title="pure javascript slide show" src="http://www.claindsilva.com/wp-content/uploads/2012/10/pure-javascript-slide-show.png" alt="pure javascript slide show" width="432" height="147" /></a>I have been always fascinated about the slideshows, how do they make one. Well here is the basic slideshow with pure JavaScript. No frameworks are used, No chunks of codes,  Simple Slideshow with 100% pure home grown JavaScript.</p>
<p><a style="color: #ff6600;" title="pure-javascript-slideshow" href="http://www.claindsilva.com/demo/pure-javascript-slideshow/" target="_blank"><strong>Demo</strong></a> <strong><a style="color: #ff6600;" href="http://www.claindsilva.com/demo/pure-javascript-slideshow/Javascript Slide Show.zip">Download Code</a></strong></p>
<p><strong>Lets start with the HTML.</strong></p>
<blockquote><p>&lt;div id=&#8221;show&#8221;&gt;<br />
&lt;div id=&#8221;slideHolder&#8221;&gt;<br />
&lt;img src=&#8221;images/slide1.jpg&#8221; /&gt;<br />
&lt;img src=&#8221;images/slide2.jpg&#8221; /&gt;<br />
&lt;img src=&#8221;images/slide3.jpg&#8221; /&gt;<br />
&lt;img src=&#8221;images/slide4.jpg&#8221; /&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<ul>
<li>div &#8220;show &#8221; &#8211; this is where the images are displayed [ fixed width/ height, overflow hidden]</li>
<li>div &#8220;slideHolder&#8221; &#8211; is the div that holds the slides [relative to "show", images float left]</li>
</ul>
<p><strong>Here is the CSS</strong></p>
<blockquote><p>#show{<br />
width:800px;<br />
height:250px;<br />
border:8px solid #E9E9E9;<br />
margin:5px auto;<br />
overflow:hidden;<br />
box-shadow:2px 2px 5px #514F4F;<br />
}<br />
#slideHolder{<br />
width:3200px;<br />
position:relative;<br />
}<br />
#slideHolder img{<br />
float:left;<br />
}</p></blockquote>
<p><strong>Slide Concept</strong></p>
<p>Use the margin left property to move the <span style="color: #3366ff;">slideHolder</span> div inwards <span style="color: #3366ff;">show</span> div.  The overflowing part is hidden by the css. A timer function is used to iteratively reduce the margin left , lets call the function as <span style="color: #3366ff;">slider()<span style="color: #000000;">. A function </span></span>named <span style="color: #3366ff;">revert()</span> is used to revert back the margins to its original position.</p>
<p><strong>The JavaScript</strong></p>
<blockquote><p>var show={};<br />
show.duration = 5000; // Delay between each slides<br />
show.speed = 5; // slide speed [should be even multiples of 5]<br />
show.width = 800; // slide width [should be even number]</p>
<p>function slider(val){<br />
document.getElementById(&#8216;slideHolder&#8217;).style.marginLeft=val+&#8217;px&#8217;;<br />
if(Math.abs(val)%show.width &gt; 0){<br />
val= val-show.speed;<br />
document.getElementById(&#8216;slideHolder&#8217;).style.marginLeft=val+&#8217;px&#8217;;<br />
setTimeout(&#8216;slider(&#8216;+val+&#8217;)',1);<br />
}else{<br />
if(Math.abs(val)==(show.width*3)){ // for 4 slides -&gt; [n-1] = 3<br />
setTimeout(&#8216;revrert(&#8216;+val+&#8217;)',show.duration);<br />
}else{<br />
val= val-show.speed;<br />
setTimeout(&#8216;slider(&#8216;+val+&#8217;)',show.duration);<br />
}<br />
}<br />
}</p>
<p>function revrert(val){ // Quick revert the margin back.<br />
if(Math.abs(val)!=0){<br />
val= val+(show.speed*2); // reverting is twice the speed of slide<br />
document.getElementById(&#8216;slideHolder&#8217;).style.marginLeft=val+&#8217;px&#8217;;<br />
setTimeout(&#8216;revrert(&#8216;+val+&#8217;)',1);<br />
}else{initSlider();}<br />
}</p>
<p>function initSlider(){<br />
setTimeout(&#8216;slider(&#8216;+(-5)+&#8217;)',show.duration);<br />
}</p>
<p>window.onload = function(){<br />
initSlider();<br />
}</p></blockquote>
<p><a style="color: #ff6600;" title="pure-javascript-slideshow" href="http://www.claindsilva.com/demo/pure-javascript-slideshow/" target="_blank"><strong>Demo</strong></a> <strong><a style="color: #ff6600;" href="http://www.claindsilva.com/demo/pure-javascript-slideshow/Javascript Slide Show.zip">Download Code</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/javascript/pure-javascript-slideshow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Animated Twitter Feed widget with Simple JavaScript</title>
		<link>http://www.claindsilva.com/javascript/animated-twitter-feed-widget-with-simple-javascript/</link>
		<comments>http://www.claindsilva.com/javascript/animated-twitter-feed-widget-with-simple-javascript/#comments</comments>
		<pubDate>Sun, 28 Oct 2012 18:07:50 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=181</guid>
		<description><![CDATA[<p><a style="color: #ff6600;" title="animated-twitter-feed" href="http://claindsilva.com/demo/animated-twitter-feed/animated-twitter-feed.php" target="_blank">Demo</a> <a style="color: #ff6600;" href="http://www.claindsilva.com/wp-content/uploads/2012/10/purejs-twitter-feed.zip">Download Code</a><br /> Here is a quick implementation of Twitter Feed using Simple JavaScript, No frameworks are used. Lets start with the HTML<a href="http://www.claindsilva.com/wp-content/uploads/2012/10/Animated-Twitter-Feed-widget-with-Simple-JavaScript.png"></a></p> <p>&#60;div id=&#8221;feedWraper&#8221;&#62;<br /> &#60;div id=&#8221;twitterFeed&#8221;&#62;&#60;/div&#62;<br /> &#60;div id=&#8221;feedCache&#8221;&#62;&#60;/div&#62;<br /> &#60;/div&#62;</p> &#8220;feedWraper &#8221; holds the widget , hence its width and height should [...]]]></description>
				<content:encoded><![CDATA[<p><a style="color: #ff6600;" title="animated-twitter-feed" href="http://claindsilva.com/demo/animated-twitter-feed/animated-twitter-feed.php" target="_blank"><strong>Demo</strong></a> <strong><a style="color: #ff6600;" href="http://www.claindsilva.com/wp-content/uploads/2012/10/purejs-twitter-feed.zip">Download Code</a></strong><br />
Here is a quick implementation of Twitter Feed using Simple JavaScript, No frameworks are used. Lets start with the HTML<a href="http://www.claindsilva.com/wp-content/uploads/2012/10/Animated-Twitter-Feed-widget-with-Simple-JavaScript.png"><img class="alignleft size-full wp-image-191" title="Animated Twitter Feed widget with Simple JavaScript" src="http://www.claindsilva.com/wp-content/uploads/2012/10/Animated-Twitter-Feed-widget-with-Simple-JavaScript.png" alt="" width="319" height="421" /></a></p>
<blockquote><p>&lt;div id=&#8221;feedWraper&#8221;&gt;<br />
&lt;div id=&#8221;twitterFeed&#8221;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;feedCache&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<ul>
<li>&#8220;feedWraper &#8221; holds the widget , hence its width and height should be fixed.</li>
<li>&#8220;twitterFeed&#8221; contains all the tweets , and its will be animated with simple JavaScript</li>
<li>&#8220;feedCache&#8221; is a hidden div that stores the tweets.</li>
</ul>
<p>&nbsp;</p>
<p>The whole process can be divided into three</p>
<ol>
<li>JSONP Call</li>
<li>Parsing JSON results [tweets]</li>
<li>Animation</li>
</ol>
<p>For the JSON call to work properly, all the supporting elements and reference functions should be available before the JSON request. That means all the HTML , CSS and JavaScript for the widget should be on the top and JSON Call should be at the bottom.</p>
<blockquote><p>function twitterCallback2(tweets){<br />
var tstatus=&#8221;;<br />
//Generate HTML links by identifying the protocols<br />
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;<br />
for(var i=0; i&lt;tweets.length; i++){<br />
tstatus = tstatus+&#8217;&lt;li&gt;&#8217;+tweets[i].text.replace(exp,&#8221;&lt;a href=&#8217;$1&#8242;&gt;$1&lt;/a&gt;&#8221;)+<br />
&#8216;&lt;br&gt;&lt;span&gt;&#8217;+tweets[i].created_at+&#8217;&lt;/span&gt;&lt;/li&gt;&#8217;;<br />
}</p>
<p>document.getElementById(&#8216;feedCache&#8217;).innerHTML = tstatus;<br />
}</p></blockquote>
<p>Function name should be same as the Json Response wrapper, here in this case twitterCallback2(). A JavaScript object is created on the JSON call and is passed into the function, here lets call it &#8220;tweets&#8221;.</p>
<p>The tweets object is plain text wrapped under object notation, hence its easy to iterate using a loop and construct the necessary HTML string. HTML string thus created is injected into the hidden div &#8220;feedCache&#8221;.</p>
<p>Call the JSONP request in a JavaScript &lt;Script&gt; tag with its &#8220;src&#8221; attribute pointing to the JSON API address</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;https://api.twitter.com/1/statuses/user_timeline.json?screen_name=clain4u&amp;callback=twitterCallback2&amp;count=10&#8243;&gt;&lt;/script&gt;</p></blockquote>
<p>Here the query string has 3 parameters.</p>
<ol>
<li><span style="color: #1782d3;">screen_name</span> <span style="color: #000000;">this is your twitter username. mine is clain4u</span></li>
<li><span style="color: #1782d3;">callback <span style="color: #000000;">this is the twitter defined call back identifier. Nothing to change here</span></span></li>
<li><span style="color: #1782d3;">count <span style="color: #000000;">this is the number of tweets you want to fetch</span></span></li>
</ol>
<p>Alright feeds will now start showing on the <span style="color: #1782d3;">twitterFeed</span> <span style="color: #000000;">div</span>. Now we need to animate the feed for scrolling effect. More clearly an infinite loop of tweets with no breaks.</p>
<p>Lets make <span style="color: #1782d3;">twitterFeed</span> relatively positioned to <span style="color: #1782d3;">feedWraper</span>, the CSS looks like this.</p>
<blockquote><p>#feedWraper{</p>
<p>/* fixed width &amp; height */<br />
<span style="color: #1782d3;">width:300px;</span><br />
<span style="color: #1782d3;">height:400px;</span><br />
<span style="color: #1782d3;">overflow:hidden;</span><br />
}<br />
#twitterFeed{<br />
<span style="color: #1782d3;">position:relative;</span><br />
width:280px;<br />
padding:10px;<br />
}<br />
#feedCache{<br />
display:none;<br />
}</p></blockquote>
<p>Make the overflow property of the <span style="color: #1782d3;">feedWraper</span> hidden so that the first fold of <span style="color: #1782d3;">twitterFeed</span> div is visible and rest are hidden.</p>
<p><span style="text-decoration: underline;"><strong>Animation concept</strong></span></p>
<p>Reduce the &#8220;margin top&#8221; property of <span style="color: #1782d3;">twitterFeed</span> div from &#8220;0px&#8221; to negative values , the div <span style="color: #1782d3;">twitterFeed </span>being relatively positioned will start to move vertically upwards beyond the <span style="color: #1782d3;">feedWraper</span> div. The overflow property of the CSS is triggers and makes the top&#8217;er part hidden. Use a loop to trigger this process , such that margin-top property value is continuously reduced with a delay.</p>
<p>One issue with this method is that, after a wile of scrolling up, the <span style="color: #1782d3;">twitterFeed <span style="color: #000000;">div</span> </span>element will have its end point and may completely disappear into the hidden wrapper. So we need to make the <span style="color: #1782d3;">twitterFeed </span><span style="color: #000000;">longer</span> vertically, append the <span style="color: #1782d3;">twitterFeed </span>div with the tweets stored in the <span style="color: #1782d3;">feedCache</span> in regular intervals such that the <span style="color: #1782d3;">twitterFeed </span>grows longer and end point is never reached. Adjust the appending process timer such that you do not overload the <span style="color: #1782d3;">twitterFeed </span> div.</p>
<p>Here I use a recursive function to trigger this animation.</p>
<blockquote><p>function animate(val){<br />
var margin = parseInt(document.getElementById(&#8216;twitterFeed&#8217;).style.marginTop.replace(&#8216;px&#8217;,&#8221;))-1;<br />
document.getElementById(&#8216;twitterFeed&#8217;).style.marginTop=margin+&#8217;px&#8217;;<br />
if(val % 200 == 0){ // after every 200 loops<br />
document.getElementById(&#8216;twitterFeed&#8217;).innerHTML = document.getElementById(&#8216;twitterFeed&#8217;).innerHTML<br />
+document.getElementById(&#8216;feedCache&#8217;).innerHTML;<br />
}<br />
setTimeout(&#8216;animate(&#8216;+(parseInt(val)+1)+&#8217;)',50);<br />
}</p></blockquote>
<p>Set the margin-top property to 0px at some point before the animate function call</p>
<p>Here is the complete final code</p>
<blockquote><p>&lt;html &gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Twitter Feed&lt;/title&gt;<br />
&lt;style&gt;<br />
&lt;!&#8211;<br />
#feedWraper{<br />
width:300px;<br />
height:400px;<br />
border:3px solid #3B8ECD;<br />
overflow:hidden;<br />
border-radius: 8px;<br />
background:#E5F7FD;<br />
}<br />
#twitterFeed{<br />
position:relative;<br />
width:280px;<br />
margin-top:0px;<br />
padding:10px;<br />
font-family:Verdana,sans-serif;<br />
font-size:11px;<br />
text-align:justify;<br />
color:#333333;<br />
font-weight:700;<br />
}<br />
#feedCache{<br />
display:none;<br />
}<br />
#twitterFeed a{<br />
color:#0099FF;<br />
}<br />
#twitterFeed ul{<br />
padding:0px;<br />
margin:0px;<br />
margin-left:10px;<br />
}<br />
#twitterFeed li{<br />
margin-bottom:10px;<br />
margin-left:10px;<br />
}</p>
<p>&#8211;&gt;<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body onload=&#8221;"&gt;<br />
&lt;div id=&#8221;feedWraper&#8221;&gt;<br />
&lt;div id=&#8221;twitterFeed&#8221;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;feedCache&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;script&gt;<br />
function twitterCallback2(tweets){<br />
var tstatus=&#8221;;<br />
//Generate HTML links by identifying the protocols<br />
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;<br />
for(var i=0; i&lt;tweets.length; i++){<br />
tstatus = tstatus+&#8217;&lt;li&gt;&#8217;+tweets[i].text.replace(exp,&#8221;&lt;a href=&#8217;$1&#8242;&gt;$1&lt;/a&gt;&#8221;)+<br />
&#8216;&lt;br&gt;&lt;span&gt;&#8217;+tweets[i].created_at+&#8217;&lt;/span&gt;&lt;/li&gt;&#8217;;<br />
}</p>
<p>document.getElementById(&#8216;feedCache&#8217;).innerHTML = tstatus;<br />
document.getElementById(&#8216;twitterFeed&#8217;).style.marginTop=&#8217;0px&#8217;;<br />
animate(0);<br />
}</p>
<p>function animate(val){<br />
var margin = parseInt(document.getElementById(&#8216;twitterFeed&#8217;).style.marginTop.replace(&#8216;px&#8217;,&#8221;))-1;<br />
document.getElementById(&#8216;twitterFeed&#8217;).style.marginTop=margin+&#8217;px&#8217;;<br />
if(val % 200 == 0){ // after every 200 loops<br />
document.getElementById(&#8216;twitterFeed&#8217;).innerHTML = document.getElementById(&#8216;twitterFeed&#8217;).innerHTML<br />
+document.getElementById(&#8216;feedCache&#8217;).innerHTML;<br />
}<br />
setTimeout(&#8216;animate(&#8216;+(parseInt(val)+1)+&#8217;)',50);<br />
}<br />
&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;https://api.twitter.com/1/statuses/user_timeline.json?screen_name=clain4u&amp;callback=twitterCallback2&amp;count=10&#8243;&gt;&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p><strong style="font-size: 18px;"><a href="http://www.claindsilva.com/wp-content/uploads/2012/10/purejs-twitter-feed.zip"><span style="color: #ff6600;">Download Code </span></a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/javascript/animated-twitter-feed-widget-with-simple-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moo Bar &#8211; Bar Chart with MooTools</title>
		<link>http://www.claindsilva.com/moo-tools/moo-bar-bar-chart-with-mootools/</link>
		<comments>http://www.claindsilva.com/moo-tools/moo-bar-bar-chart-with-mootools/#comments</comments>
		<pubDate>Thu, 05 Jul 2012 16:59:40 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Moo Tools]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=167</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/07/Moo-Bar-Mootools-barChart.png"></a> Introducing Moo Bar  bar chart plugin for easy HTML bar chart creation.</p> <p>Features</p> HTML friendly No canvas element required Cross browser compatible <p>Written for  Moo tools version  1.2  and above, works fine with Moo tools 1.4. The plugin features a fully configurable moo bar class .  See the live <a href="http://www.claindsilva.com/demo/moobar/">demo here.</a></p> <a [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/07/Moo-Bar-Mootools-barChart.png"><img class="alignleft size-medium wp-image-168" title="Moo-Bar Mootools bar chart" src="http://www.claindsilva.com/wp-content/uploads/2012/07/Moo-Bar-Mootools-barChart-300x104.png" alt="Moo-Bar Mootools bar chart" width="300" height="104" /></a> Introducing <strong>Moo Bar</strong>  bar chart<strong></strong> plugin for easy HTML bar chart creation.</p>
<p><strong>Features</strong></p>
<ul>
<li>HTML friendly</li>
<li>No canvas element required</li>
<li>Cross browser compatible</li>
</ul>
<p>Written for  Moo tools version  1.2  and above, works fine with Moo tools 1.4. The plugin features a fully configurable <strong>moo bar</strong> class .  See the live <a href="http://www.claindsilva.com/demo/moobar/"><strong>demo here.</strong></a></p>
<h4><span style="color: #ff6600;"><a title="Download Moo Bar" href="http://www.claindsilva.com/demo/moobar/moo-bar.zip" target="_blank"><span style="color: #ff6600;"><strong>Download Moo Bar</strong></span></a></span></h4>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/moo-tools/moo-bar-bar-chart-with-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Event Manager using PHP &amp; Mootools</title>
		<link>http://www.claindsilva.com/web-development/simple-event-manager-using-php-mootools/</link>
		<comments>http://www.claindsilva.com/web-development/simple-event-manager-using-php-mootools/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 14:27:50 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Latest Work]]></category>
		<category><![CDATA[Moo Tools]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=155</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/06/Event-Manager-dashboard.png"></a>   Simple Event Manager as the name says is a simple implementation of events calender.</p> <p>Inspirations and Supporting Packages.<br /> Inspired by the very simple event list by <a href="http://ekittell.com" target="_blank">Eric Kittal</a>, and <a href="http://dev.base86.com/scripts/mootools_javascript_datepicker_calendar_eightysix.html" target="_blank">Moo tools Ajax calender</a></p> <p>The Tool<br /> Powered with PHP &#8211; MySQL back end  and Moo Tool on the [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/06/Event-Manager-dashboard.png"><img class="alignleft size-medium wp-image-158" title="Event Manager Dashboard" src="http://www.claindsilva.com/wp-content/uploads/2012/06/Event-Manager-dashboard-300x91.png" alt="Event Manager Dashboard" width="300" height="91" /></a>   Simple Event Manager as the name says is a simple implementation of events calender.</p>
<p><strong>Inspirations and Supporting Packages</strong>.<br />
Inspired by the very simple event list by <a href="http://ekittell.com" target="_blank">Eric Kittal</a>, and <a href="http://dev.base86.com/scripts/mootools_javascript_datepicker_calendar_eightysix.html" target="_blank">Moo tools Ajax calender</a></p>
<p><strong>The Tool</strong><br />
Powered with PHP &#8211; MySQL back end  and Moo Tool on the frond end, this one is a nifty tool for those who love simplicity. Simple event manager is capable of storing the events with date and time. Other fields include &#8220;Event Title&#8221; and &#8220;Description&#8221; .</p>
<p>Event manager is comes with multi-user  log in , events are tracked and named after the user who created it.  Irrespective of the user who created it , the events are visible to all the users. Making it a tool for collaborative work environment as well .</p>
<p><strong>Installation and customization<br />
</strong></p>
<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/06/Event-Manager.png"><img class="alignright size-medium wp-image-161" title="Event Manager" src="http://www.claindsilva.com/wp-content/uploads/2012/06/Event-Manager-300x168.png" alt="Event Manager" width="300" height="168" /></a>Download and extract all the files , within the admin.php file you need to set the timezone,  Event manager uses <a href="http://www.google.co.in/url?sa=t&amp;rct=j&amp;q=php%20timezones&amp;source=web&amp;cd=1&amp;ved=0CF8QFjAA&amp;url=http%3A%2F%2Fphp.net%2Fmanual%2Fen%2Ftimezones.php&amp;ei=VofgT9DrL8jQrQeW3aGBDQ&amp;usg=AFQjCNEdPEtJ9u0k81ACSzZdfXFhAfm9WQ&amp;cad=rja" target="_blank">PHP timezones</a>, find yours and modify accordingly.</p>
<pre>$timezone = "Asia/Calcutta";</pre>
<p>Sorry guys &#8230; there is no specific configuration file where you can tweak in all the settings at this time ,  Lets play arround. Next is database, you can find the <strong>sql schema</strong> inside the <strong>schema</strong> folder,  grab it and create the tables. Its a very simple straight forward sql.  Create your own user name and password entry in the &#8220;event_user&#8221; table. The fields are plain text and no encryption is implemented. Done&#8230;..!! Lets login now using the created user name and password.</p>
<p>Point your browser to event manager folder</p>
<pre>eg : http://yourhost/EventManager/</pre>
<p>You should see the log in screen now&#8230; Enjoy..!!  Feel free to modify rebuild and redistribute the code.  Its licensed under GNU for PHP code and has an MIT license for MooTools  codes [Both Open and free].</p>
<p>Feel free to approach me for any quires and help.</p>
<h3><span style="color: #3366ff;"><a href="http://www.claindsilva.com/wp-content/uploads/2012/06/EventManager.zip"><span style="color: #3366ff;">Download Simple Event Manager</span></a></span></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/web-development/simple-event-manager-using-php-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON, JSONP , XML, RSS Feed and Google RSS  to Jason API</title>
		<link>http://www.claindsilva.com/web-development/json-jsonp-xml-rss-feed-and-google-rss-to-jason-api/</link>
		<comments>http://www.claindsilva.com/web-development/json-jsonp-xml-rss-feed-and-google-rss-to-jason-api/#comments</comments>
		<pubDate>Sun, 20 May 2012 03:16:29 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Moo Tools]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=145</guid>
		<description><![CDATA[<p>&#160;</p> <p class="MsoNormal">Gone are days of origin policy and cross website data access. In the modern world data needs to be librated. Its one such idea that gave birth to JSON.  JSON is simply JavaScript Object  Notation and it’s a plain text data transfer method using JavaScript. Unlike XML which need a server side program [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p class="MsoNormal"><img style="float: left;" src="http://www.claindsilva.com/wp-content/uploads/2012/05/json.jpg" alt="RSS to JSONP " width="152" height="162" />Gone are days of origin policy and cross website data access. In the modern world data needs to be librated. Its one such idea that gave birth to JSON.<span>  </span>JSON is simply JavaScript Object<span>  </span>Notation and it’s a plain text data transfer method using JavaScript. Unlike XML which need a server side program to process the xml, JSON does not need a backend to process.<span>  </span>JSON is processed within your browser by the JavaScript.<span>  </span>Now that’s something that’s really interesting.</p>
<p class="MsoNormal"><strong>JSON</strong></p>
<p class="MsoNormal">As I mentioned before , <a title="JSON website" href="http://www.json.org/" target="_blank">JSON</a> a plain text representation of data which is easily readable .</p>
<p class="MsoNormal"><strong>Sample Json Segment:</strong></p>
<pre class="de1"><span style="color: #800000;"><span class="br0">{</span> <span class="st0">"firstName"</span><span class="sy0">:</span> <span class="st0">"John"</span><span class="sy0">,
</span> <span class="st0">"lastName"</span> <span class="sy0">:</span> <span class="st0">"Smith"</span><span class="sy0">,
</span> <span class="st0">"age"</span> <span class="sy0">:</span> <span class="nu0">25</span><span class="sy0">,
</span> <span class="st0">"address"</span> <span class="sy0">:
</span> <span class="br0"> {</span> 
<span class="st0"> "streetAddress"</span><span class="sy0">:</span> <span class="st0">"21 2nd Street"</span><span class="sy0">,
 </span> <span class="st0">"city"</span> <span class="sy0">:</span> <span class="st0">"New York"</span><span class="sy0">,</span>
  <span class="st0"> "state"</span> <span class="sy0">:</span> <span class="st0">"NY"</span><span class="sy0">,
</span> <span class="st0"> "postalCode"</span> <span class="sy0">:</span> <span class="st0">"10021"</span> <span class="br0">
 }</span><span class="sy0">,
</span> <span class="st0">"phoneNumber"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{
</span>  <span class="st0">"type"</span> <span class="sy0">:</span> <span class="st0">"home"</span><span class="sy0">,</span>
  <span class="st0">"number"</span><span class="sy0">:</span> <span class="st0">"212 555-1234"
 </span> <span class="br0">}</span><span class="sy0">,
</span> <span class="br0"> {
</span>  <span class="st0">"type"</span> <span class="sy0">:</span> <span class="st0">"fax"</span><span class="sy0">,
</span><span class="st0"> "number"</span><span class="sy0">:</span> <span class="st0">"646 555-4567"</span> <span class="br0">
 }</span> <span class="br0">]</span> <span class="br0">}</span></span></pre>
<p class="MsoNormal">Advantages :</p>
<p class="MsoListParagraphCxSpFirst" style="margin-left: 40.5pt; text-indent: -0.25in;"><span style="font-family: Symbol;"><span>·<span style="font: 7pt 'Times New Roman';">         </span></span></span>Json data is processed by JavaScript within the browser without sending it to the server.</p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left: 40.5pt; text-indent: -0.25in;"><span style="font-family: Symbol;"><span>·<span style="font: 7pt 'Times New Roman';">         </span></span></span>JSON being in plain text format , loads faster. Since it is not made up of tags like XML the amount of data transferred is bare minimum to the actual required data.</p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left: 40.5pt; text-indent: -0.25in;"><span style="font-family: Symbol;"><span>·<span style="font: 7pt 'Times New Roman';">         </span></span></span>Loading and processing the data on client side removes server overhead.</p>
<p class="MsoListParagraphCxSpLast" style="margin-left: 40.5pt; text-indent: -0.25in;"><span style="font-family: Symbol;"><span>·<span style="font: 7pt 'Times New Roman';">         </span></span></span>Live feed becomes a reality with JSON,<span>  </span>Applications that requires live data , for example : Stock market, Sports Score, Live news ..etc can use a JSON feed with fetch intervals set within the JavaScript and inject the live data into webpage.</p>
<p class="MsoNormal"><strong>JSONP</strong></p>
<p class="MsoNormal"><a title="JSONP" href="http://json-p.org/" target="_blank">JSONP</a> is the new protocol that lets you access JSON feed from domains other than your domain, in other words remote domain or cross domain.<span>  </span>This is useful when you need to incorporate an API based on<span>  </span>JSON. <span> </span>Unlike SOAP, REAST, or WML which is markup or tag oriented, <span> </span>JSON has less data transferred over an API making it a faster and powerful API format.</p>
<p class="MsoNormal"><strong>The Problem</strong></p>
<p class="MsoNormal">Like any emerging trend, websites / people around the world did not move to the new JSON technology. Most of the websites and services sticked <span> </span>on to XML / RSS/ATOM format which is basically of XML origin.</p>
<p class="MsoNormal"><strong>The Google RSS to JSON API[Google Feed API]</strong></p>
<p class="MsoNormal">Google was first to break the XML – JSON barrier.<span>  </span>Google came up with Its own <a title="Google Feed API" href="https://developers.google.com/feed/v1/jsondevguide" target="_blank">RSS to JSON API</a> based on JSON.<span>  </span>The goggle API looks like this.</p>
<p class="MsoNormal"><a title="Moo Tools Website" href="http://mootools.net/" target="_blank">Moo Tools</a> Based JavaScript Code segment</p>
<pre id="line1"><span style="color: #800000;">function fbLookup(fbuser)
{ 
 new Request.JSONP({ url: 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;num=10&amp;q='
 +encodeURIComponent('http://www.facebook.com/feeds/page.php?format=rss20&amp;id='+fbuser),
 onComplete: function(data){ 
 var fstatus='';
 data.responseData.feed.entries.each(function(ffeed){
  if(ffeed.content != ''){ 
 fstatus = fstatus+'&lt;li&gt;&lt;div&gt;'+ffeed.publishedDate+ '&lt;/div&gt;'+ffeed.content +'&lt;/li&gt;'; 
 }
  });
$('facebookfeedholder').set('html', '&lt;h3&gt;Live Feed&lt;/h3&gt;&lt;div id="facebookfeed"&gt;&lt;ul&gt;' +fstatus+'&lt;/ul&gt;&lt;/div&gt;');
 } }).send();}</span></pre>
<p><span style="font-size: 11pt; line-height: 115%; font-family: 'Calibri','sans-serif';">The FEED to Jsonaccepts one parameter. Yes you guessed it right, it’s the URL to the RSS feed and returns you a feed in JSON format.</span></p>
<p><span style="font-size: 11pt; line-height: 115%; font-family: 'Calibri','sans-serif';">The above code segment will accept a facebook pagename / username and returns their latest wall posts and injects them to HTML page element with the id  &#8216;facebookfeedholder&#8217;</span></p>
<p><span style="font-size: 11pt; line-height: 115%; font-family: 'Calibri','sans-serif'; color: #800000;">&lt;div id=&#8217;facebookfeedholder&#8217;&gt;&lt;/div&gt;</span></p>
<p><span style="font-size: 11pt; line-height: 115%; font-family: 'Calibri','sans-serif';">Come on guys give a try with JSONP .. Grab your favourite feed and do some JSON fun.</span></p>
<p><span style="font-size: 11pt; line-height: 115%; font-family: 'Calibri','sans-serif';">Hope you enjoyed this post, dont forget to leave your comments.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/web-development/json-jsonp-xml-rss-feed-and-google-rss-to-jason-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Distilinfo Twitter Integration</title>
		<link>http://www.claindsilva.com/latest-work/distilinfo-twitter-integration/</link>
		<comments>http://www.claindsilva.com/latest-work/distilinfo-twitter-integration/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 04:49:24 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[Latest Work]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/index.php/?p=131</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/01/Twitterlatest.png"></a>Happy to integrate twitter for Distil Info Systems.  Much more happy to see that client is happy about it.</p>  Kudos to you, <a href="mailto:clain@claindsilva.com">clain@claindsilva.com</a> for cracking the Twitter integration. Great Job &#8211; BoM <p style="text-align: right;">-@Distilinfo</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2012/01/Twitterlatest.png"><img class="alignleft size-full wp-image-135" title="Twitter Latest" src="http://www.claindsilva.com/wp-content/uploads/2012/01/Twitterlatest.png" alt="Twitter Latest" width="128" height="128" /></a>Happy to integrate twitter for Distil Info Systems.  Much more happy to see that client is happy about it.</p>
<blockquote>
<h4><span style="color: #333333;"><strong> Kudos to you, <a href="mailto:clain@claindsilva.com"><span style="color: #333333;">clain@claindsilva.com</span></a> for cracking the Twitter integration. Great Job &#8211; BoM</strong></span></h4>
</blockquote>
<p style="text-align: right;">-@Distilinfo</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/latest-work/distilinfo-twitter-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emotion Of a Website</title>
		<link>http://www.claindsilva.com/web-development/emotion-of-a-website/</link>
		<comments>http://www.claindsilva.com/web-development/emotion-of-a-website/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 10:15:05 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/?p=78</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2011/12/Emotion-Of-website.jpg"></a>Well I know that most of you might wonder about the title.  Does a website have an emotion?.</p> <p>Last day I was in a meeting with one of my client  and a content writer.  The content writer and me brainstormed to bring up a presentable sitemap and content flow structure to the client.  After [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2011/12/Emotion-Of-website.jpg"><img class="alignleft size-medium wp-image-87" title="Emotion Of  a Website" src="http://www.claindsilva.com/wp-content/uploads/2011/12/Emotion-Of-website-300x223.jpg" alt="Emotion Of  A Website" width="300" height="223" /></a>Well I know that most of you might wonder about the title.  Does a website have an emotion?.</p>
<p>Last day I was in a meeting with one of my client  and a content writer.  The content writer and me brainstormed to bring up a presentable sitemap and content flow structure to the client.  After hearing us , the client asked us</p>
<blockquote>
<ul>
<li>What is the emotion of this proposed website?</li>
<li>With what emotion this website is going to approach the audience?</li>
</ul>
</blockquote>
<p>We did not had an answer at that time. I have been developing websites for the past few years and I never  have thought of the fact that the website do have emotions.</p>
<p>After thinking a lot I thought to go for a study and here are the few things that I found for a website to have Emotion.<a href="http://www.claindsilva.com/wp-content/uploads/2011/12/Website-with-emotion.png"><img class="alignright size-medium wp-image-89" title="Website with emotion" src="http://www.claindsilva.com/wp-content/uploads/2011/12/Website-with-emotion-300x287.png" alt="Website with emotion" width="300" height="287" /></a></p>
<ul>
<li><strong>Audience Have  Emotions</strong> &#8211; Every visitor goes to a website seeking something, say .. some need a solution,  some come for entertainment,  some are confused and so on.  A website must be intelligent to capture the emotion of the user and give him the right page / link / solution. In simple words a website should be intelligent.</li>
<li><strong>FAST is the current Trend</strong> &#8211; Everybody wants the information in a fraction of second. If they don&#8217;t find it, they will jump to another website/ resource that can give them a quick result. Gone are the days where the website had tones of text written in 10 paragraphs. Here the website needs to be clever enough to present the date in very brief and descriptive.</li>
</ul>
<blockquote><p>A website content should be like a &#8221; Mini Skirt&#8221;  Short enough to keep the viewer interested and long enough to cover the subject</p></blockquote>
<ul>
<li><strong>Keep the audience entertained </strong>- the language and the UI can be more  playful and interactive. With the emergence of WEB 2.0 its very easily possible. The more the user interacts the more they retain. Another thing with an interactive website is that we can easily get to know what the user is expecting.</li>
</ul>
<p>To conclude there should be a balanced emotions mixed up with the website such that the emotion of the website meets the emotion of the targeted audience. For Example : A  charity website should have the emotions of humanity and off course empathy.</p>
<p><a href="http://www.claindsilva.com/wp-content/uploads/2011/12/website-emotion.jpg"><img class="alignleft size-large wp-image-90" title="website with emotion" src="http://www.claindsilva.com/wp-content/uploads/2011/12/website-emotion-1024x670.jpg" alt="website with emotion" width="595" height="389" /></a></p>
<p>Modern websites are representatives of an individual, Company an organization ..etc hence its vitally important for a website to have the emotion of the entity it represents.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/web-development/emotion-of-a-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading Gmail With PHP IMAP</title>
		<link>http://www.claindsilva.com/php/reading-gmail-with-php-imap/</link>
		<comments>http://www.claindsilva.com/php/reading-gmail-with-php-imap/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 07:35:40 +0000</pubDate>
		<dc:creator>Clain</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.claindsilva.com/?p=72</guid>
		<description><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2011/11/gmail-PHP-IMAP.png"></a>Hello my dear friends, Now this is quite interesting topic for all the PHP newbies and off course OLD bees..!! You might have seen many large PHP libraries that is designed to access emails and send emails. Well this one is going to be a lot more simpler than a HUGE MAIL Library.</p> <p>To [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.claindsilva.com/wp-content/uploads/2011/11/gmail-PHP-IMAP.png"><img class="alignleft size-medium wp-image-73" title="gmail-PHP-IMAP" src="http://www.claindsilva.com/wp-content/uploads/2011/11/gmail-PHP-IMAP-300x300.png" alt="Reading Gmail With PHP IMAP" width="300" height="300" /></a>Hello my dear friends, Now this is quite interesting topic for all the PHP newbies and off course OLD bees..!! You might have seen many large PHP libraries that is designed to access emails and send emails. Well this one is going to be a lot more simpler than a HUGE MAIL Library.</p>
<p>To start with we should have the following minimum requirements</p>
<ul>
<li>PHP5</li>
<li>IMAP enabled in your Gmail settings.</li>
<li>PHP IMAP Extension is enabled [Its a default package with PHP]</li>
</ul>
<p>Lets start with connection configuration.</p>
<blockquote><p>/* connect to gmail */<br />
$hostname = &#8216;{imap.gmail.com:993/imap/ssl}INBOX&#8217;;<br />
$username = &#8216;username@gmail.com&#8217;;<br />
$password = &#8216;password&#8217;;</p></blockquote>
<p>Replace the values with the Gmail account details that you need to access. The host name need not be altered, its the standard gmail IMAP address.</p>
<p>Now lets connect to Gmail using IMAP.</p>
<blockquote><p>$inbox = imap_open($hostname,$username,$password) or die(&#8216;Cannot connect to Gmail: &#8216; . imap_last_error());</p></blockquote>
<p>Once connected you can access the inbox using imap_search() function</p>
<blockquote><p>$emails = imap_search($inbox,&#8217;UNSEEN&#8217;);</p>
<p>// ALL &#8211; All emails<br />
// UNSEEN &#8211; Gets you the message which is not yet read.</p></blockquote>
<p>imap_search returns all the email ID&#8217;s which are unread and we need to iterate through the ID&#8217;s to read the emails</p>
<blockquote><p>if($emails) { // Check if there are any emails</p>
<p>rsort($emails); /* Sorts the email such that the new emails comes first*/</p>
<p>/*  Get the email one by one using ID */<br />
foreach($emails as $email_number) {<br />
// Get the email [headers]  like FROM, TO, SUBJECT, DATE, SERVER etc<br />
$overview = imap_fetch_overview($inbox,$email_number,0);<br />
echo $overview[0]-&gt;subject.&#8221;\n&#8221;;</p>
<p>// Get the Email Body<br />
$message = imap_fetchbody($inbox,$email_number,1);</p>
<p>echo $message;  // Prints the message in Text format.<br />
}</p>
<p>}</p>
<p>/* close the connection */<br />
imap_close($inbox);</p></blockquote>
<h3><span style="color: #ff0000;"><a href="http://www.claindsilva.com/wp-content/uploads/2011/11/Gmail_PHP_IMAP.zip"><span style="color: #ff0000;">Download Source file</span></a></span></h3>
<p>Hope you have enjoyed this Post.!! Leave your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claindsilva.com/php/reading-gmail-with-php-imap/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
