<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>dtsn | I build cool stuff for the web.</title>
	
	<link>http://dtsn.co.uk</link>
	<description>Personal Blog of Daniel Saxil-Nielsen</description>
	<pubDate>Wed, 17 Jun 2009 22:25:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/dtsn" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">dtsn</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>TweetTabs, A Story</title>
		<link>http://dtsn.co.uk/2009/06/17/tweettabs-a-story/</link>
		<comments>http://dtsn.co.uk/2009/06/17/tweettabs-a-story/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 22:09:51 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[TweetTabs]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=574</guid>
		<description><![CDATA[For everyone who follows me on twitter (@dtsn) or knows me personally would know that yesterday I launched something that i have been working on&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/' rel='bookmark' title='Permanent Link: What’s wrong with Tweetdeck'>What’s wrong with Tweetdeck</a> <small> I design lots of user interfaces for varying different...</small></li><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li><li><a href='http://dtsn.co.uk/2009/02/10/new-year-new-design/' rel='bookmark' title='Permanent Link: New Year, New Design'>New Year, New Design</a> <small>It has been a long time since I have touched...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>For everyone who follows me on twitter (<a href="http://twitter.com/dtsn" target="_blank">@dtsn</a>) or knows me personally would know that yesterday I launched something that i have been working on for a very long time. <a href="http://tweettabs.com">TweetTabs</a> is a way of tracking real-time twitter trends and searches, and has been my little project since i first started on it back in Easter. The idea came from the lack on online real-time ways to interface with twitter, the premise is simple, i wanted an easy way to search for things in twitter which constantly updated, so TweetTabs was born. </p>
<p>The initial application was written in about 2 hours entirely in JavaScript, it later went through a number of huge revisions especially over the Easter weekend. It gained quite a lot of features, and then lost them. I wrote an entire OAuth module in JavaScript, then realised that you can’t authenticate headers. The project was basically done apart from one of the most complicated features. Then my life changed, I broke up with my long term girlfriend, of 5 years, and had to move back home with my parents. Even though this didn’t dent my enthusiasm for the project it definitely affected the timescales.</p>
<h2>How it works</h2>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/06/image-thumb.png" width="480" height="310" /></p>
<p>TweetTabs is a very simple idea, but it takes a very long time to solve the problems it presents. The entire application is written in JavaScript, this gets around the notion of having a API limit for your twitter searches, you are now only limited by your I.P. address, which has a much higher (not declared) limit. For every tab TweetTab hits twitter to fetch the data, this is controlled by our adaptive pollrate. Put simply this means that each tab can work out the optimum time to fetch more data from twitter. We try and limit the number of times TweetTabs hits twitter in the hour, mostly so that you don&#8217;t reach your API limit (it is possible, and I did it a lot in testing), and we don&#8217;t overload twitter.</p>
<p> <object width="480" height="360"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5208057&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5208057&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="360"></embed></object>
<p><a href="http://vimeo.com/5208057">TweetTabs Screencast</a> from <a href="http://vimeo.com/user546294">Daniel Saxil-Nielsen</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<h2>Coverage</h2>
<p>So now TweetTabs has been launched and has had loads of positive feedback and has been covered on loads of huge sites:</p>
<ul>
<li><a title="http://www.techcrunch.com/2009/06/16/tweettabs-is-an-awesome-way-to-search-twitter/" href="http://www.techcrunch.com/2009/06/16/tweettabs-is-an-awesome-way-to-search-twitter/">http://www.techcrunch.com/2009/06/16/tweettabs-is-an-awesome-way-to-search-twitter/</a> </li>
<li><a title="http://mashable.com/2009/06/16/tweettabs/" href="http://mashable.com/2009/06/16/tweettabs/">http://mashable.com/2009/06/16/tweettabs/</a> </li>
</ul>
<h2>Dedications</h2>
<p>I don’t know whether this is normally done for releasing products, but I feel it is appropriate, I would like to mention everyone who helped with the process along the way. Starting firstly with <a href="http://twitter.com/nickhalstead" target="_blank">@nickhalstead</a>, who supported me the whole way (and sorry it took so long). <a href="http://twitter.com/nicktelford" target="_blank">@nicktelford</a> who was there to bounce ideas of and to find lots of bugs just before we were about the launch. <a href="http://twitter.com/alexforrow" target="_blank">@alexforrow</a> for writing a really good deployment script, which merges all the files and obfuscates them. All the great people that tested it along the way: <a href="http://twitter.com/chris_alexander" target="_blank">@chris_alexander</a>, <a href="http://twitter.com/craigyd" target="_blank">@craigyd</a>, <a href="http://twitter.com/amykate" target="_blank">@amykate</a> and <a href="http://twitter.com/girlygeekdom" target="_blank">@girlygeekdom</a> (who is probably the one who answers <a href="http://twitter.com/tweettabs" target="_blank">@tweettabs</a> questions online). </p>
<p>TweetTabs is built using <a href="http://prototypejs.org" target="_blank">Prototype</a> and the JavaScript framework, and is powered by <a href="http://tweetmeme.com">TweetMeme</a>, and <a href="http://twitter.com" target="_blank">Twitter</a>.     </p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/' rel='bookmark' title='Permanent Link: What’s wrong with Tweetdeck'>What’s wrong with Tweetdeck</a> <small> I design lots of user interfaces for varying different...</small></li><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li><li><a href='http://dtsn.co.uk/2009/02/10/new-year-new-design/' rel='bookmark' title='Permanent Link: New Year, New Design'>New Year, New Design</a> <small>It has been a long time since I have touched...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dtsn?a=uZL4SggB4qA:OU47bIZTTDE:IuXuQPol3sE"><img src="http://feeds.feedburner.com/~ff/dtsn?i=uZL4SggB4qA:OU47bIZTTDE:IuXuQPol3sE" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=uZL4SggB4qA:OU47bIZTTDE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/dtsn?i=uZL4SggB4qA:OU47bIZTTDE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=uZL4SggB4qA:OU47bIZTTDE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/dtsn?i=uZL4SggB4qA:OU47bIZTTDE:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/06/17/tweettabs-a-story/feed/</wfw:commentRss>
		</item>
		<item>
		<title>6 Cartoons about being a Web Developer</title>
		<link>http://dtsn.co.uk/2009/04/29/6-cartoons-about-being-a-web-developer/</link>
		<comments>http://dtsn.co.uk/2009/04/29/6-cartoons-about-being-a-web-developer/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 13:00:24 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=558</guid>
		<description><![CDATA[With it still being April and with all the disasters going on. I thought I would lighten the mood share with you a number of&#8230;


No related posts.]]></description>
			<content:encoded><![CDATA[<p>With it still being April and with all the disasters going on. I thought I would lighten the mood share with you a number of funny links and cartoons/drawings about being a web developer, which I have been collected recently. Please let me know if you find any more.</p>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/04/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/04/image-thumb.png" width="480" height="152" /></a></p>
<p>Dilbert 404 Error Page</p>
<p align="center"><a href="http://www.socialsignal.com/cartoon/south-souwester"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/04/image4.png" width="285" height="306" /></a></p>
<p><a href="http://www.socialsignal.com/cartoon/south-souwester">South by Sou&#8217;wester</a></p>
<p><a href="http://mingle2.com/blog/view/web-developer-mind"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/04/image-thumb2.png" width="480" height="464" /></a></p>
<p>The Mind of a Web Developer <a href="http://mingle2.com/blog/view/web-developer-mind">mingle<sup>2</sup></a></p>
<p><a href="http://www.bradcolbow.com/archive.php/?p=34"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/04/image5.png" width="480" height="326" /></a></p>
<p><a href="http://www.bradcolbow.com/archive.php/?p=34">The Brads - WiFi</a></p>
<p><a href="http://www.themaninblue.com/"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/04/image-thumb3.png" width="480" height="591" /></a>     <br />Small talk with a web designer – <a href="http://www.themaninblue.com/">The Man In Blue</a></p>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/04/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/04/image-thumb4.png" width="480" height="360" /></a> </p>
<p>Web Development Project Management Cartoon – <a href="http://www.projectcartoon.com/cartoon/11920">The Project Management Cartoon</a> via <a href="http://www.andysowards.com/blog/nerd-fun/web-development-project-management-cartoon">Andy Sowards</a></p>


<p>No related posts.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dtsn?a=VJSPI-peOU8:ShP3B_kpG3U:IuXuQPol3sE"><img src="http://feeds.feedburner.com/~ff/dtsn?i=VJSPI-peOU8:ShP3B_kpG3U:IuXuQPol3sE" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=VJSPI-peOU8:ShP3B_kpG3U:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/dtsn?i=VJSPI-peOU8:ShP3B_kpG3U:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=VJSPI-peOU8:ShP3B_kpG3U:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/dtsn?i=VJSPI-peOU8:ShP3B_kpG3U:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/04/29/6-cartoons-about-being-a-web-developer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What’s wrong with Tweetdeck</title>
		<link>http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/</link>
		<comments>http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 13:19:01 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=546</guid>
		<description><![CDATA[
I design lots of user interfaces for varying different types of products on different platforms. So I find it very annoying when I encounter a&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://dtsn.co.uk/wp-content/uploads/2009/03/tweetdeck.gif" alt="Whats wrong with Tweetdeck" /></p>
<p>I design lots of user interfaces for varying different types of products on different platforms. So I find it very annoying when I encounter a product which is functionally brilliant but lacks an easy to use interface. I find the user interface for the popular twitter client <a href="http://www.tweetdeck.com">Tweetdeck</a> is lacking the necessary interface for it to become a brilliant application. </p>
<h4>Loading Tweetdeck</h4>
<p>When Tweetdeck initially loads up there are no loading symbols in any of the columns, this is also true when you create a new column or a new search. Ideally Tweetdeck would show a loading spinner to give you the idea that the program is actually doing something.</p>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/03/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/03/image-thumb.png" width="481" height="258" /></a> </p>
<h4>The Tweets</h4>
<p>Each tweet is of a uniformed height which really doesn’t make use of the space available. This becomes even more apparent when you switch on the option of narrow columns. Why can’t the columns be resizable? This would allow you to have as many as you want within the viewport of your screen. One of the biggest flaws in Tweetdeck are in the tweets, links do not have a rollover! There is also no way of knowing if you have actually clicked on the link and it’s opening a webpage.</p>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/03/image1.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/03/image-thumb1.png" width="148" height="240" /></a> </p>
<h4>Notifications</h4>
<p>The Tweetdeck notification system is not only annoying, it is also useless, they are trying the mimic the <a href="http://growl.info/">GROWL</a> notification system for Mac, but without any of the benefits. The notifications contain no real information, like who tweeted what, it only contains a count. There is also no way for you to choose the location of the notification, by default it pops up in the top right of the screen. The major place, especially on windows, where important buttons are positioned. There is also no setting to adjust the time the notification would display for.</p>
<h4>Summary</h4>
<p>Don&#8217;t get me wrong, I love Tweetdeck, I use it everyday but i would just like to see a number of improvements so that I am able to use it everyday all day, without continually looking for a new solution for the Twitter client problem.</p>
<p>Do you have any problems with Tweetdeck, any little problems which you think would make a big difference? Or have you found a great replacement for Tweetdeck? Let me know in the comments below.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dtsn?a=wdv7O_Arp_w:UMLaxKjvXe8:IuXuQPol3sE"><img src="http://feeds.feedburner.com/~ff/dtsn?i=wdv7O_Arp_w:UMLaxKjvXe8:IuXuQPol3sE" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=wdv7O_Arp_w:UMLaxKjvXe8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/dtsn?i=wdv7O_Arp_w:UMLaxKjvXe8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=wdv7O_Arp_w:UMLaxKjvXe8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/dtsn?i=wdv7O_Arp_w:UMLaxKjvXe8:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/03/28/what%e2%80%99s-wrong-with-tweetdeck/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building JavaScript Widgets</title>
		<link>http://dtsn.co.uk/2009/03/15/building-javascript-widgets/</link>
		<comments>http://dtsn.co.uk/2009/03/15/building-javascript-widgets/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 12:18:09 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=530</guid>
		<description><![CDATA[
Little pieces of JavaScript you embed onto your website are getting more popular. Every major provider of a service on the web also gives you&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a> <small>Halloween is just around the corner and what better to...</small></li><li><a href='http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/' rel='bookmark' title='Permanent Link: Designing For The iPhone'>Designing For The iPhone</a> <small> Yep, we have done it again, Tweetmeme has just...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://dtsn.co.uk/wp-content/uploads/2009/03/buidling_javascript_widgets1.gif" alt="Building JavaScript Widgets" /></p>
<p>Little pieces of JavaScript you embed onto your website are getting more popular. Every major provider of a service on the web also gives you a little widget that you can put on your blog or webpage to promote what you are doing, for example <a href="http://twitter.com/widgets" target="_blank">Twitter</a>, <a href="http://www.last.fm/widgets" target="_blank">Last FM</a> and <a href="http://digg.com/add-digg" target="_blank">Digg</a> all provide widgets which are great for you and great for the service.</p>
<p>I am going to talk you through the development and pitfalls associated with the design and development of widgets. </p>
<p>First and foremost, you need to decide what you want to show with your widget. Knowing this you can make an educated choice about which method you want to use to create a widget, there are basically two methods associated with widget development.</p>
<h4>iframe’s</h4>
<p>No, iframe’s aren’t dead. They are a major part of widget development. Using a <code>iframe</code> is the easiest way to generate a widget - you host a small file on your web site which contains the information you want to show, like the <a href="http://digg.com/tools/diggthis.php?u=http%3A//hehe2.net/linux-general/linuxcom-to-bring-social-web-to-linux-geeks/&amp;t=Linux.com%20to%20Bring%20%u201CSocial%20Web%u201D%20To%20Linux%20Geeks%3F" target="_blank">Digg button</a> for example, and get the JavaScript on the client side to build the URL to it. In the case of Digg the client side JavaScript builds a URL based on the current posts URL.</p>
<pre class="javascript" name="code">
document.write('<iframe src="http://yoururl" width="50" height="50"></iframe>');
</pre>
<p>To install the widget all you have to do is to point the user at your bit of JavaScript:</p>
<pre class="html" name="code">
<script src="http://yoururl/script.js" type="text/javascript"></script>
</pre>
<p>You can pass any variables you want through to the user at this point by simply making them JavaScript variables, and using the JavaScript to build up the <code>iframe</code> URL based on these variables.</p>
<pre class="html" name="code">
<script type="text/javascript">
	var greeting = 'hello world';
</script>
<script src="http://yoururl/script.js" type="text/javascript"></script>
</pre>
<p>If you want your widget to be able to appear multiple times on the same webpage, you need to remember to set all the variables to <code>null</code> at the end of your JavaScript file.</p>
<p>That&#8217;s it! <code>iframe</code> based widgets are very easy to build and to use, however they do come with their downsides. The biggest of these is that the user can&#8217;t customise the widget at all - it lives within an <code>iframe</code> and therefore is untouchable by CSS. That&#8217;s why certain widgets, like the twitter widget, which are made entirely on the client side in JavaScript.</p>
<h4>Client Side</h4>
<p>A widget that is built in JavaScript on the client side is definitely the harder option. For this you have to make the JavaScript file create all the HTML, write out a basic style to apply to the HTML and load in the data. When building this try to avoid using frameworks to build the HTML, this only creates more request for your web servers and make the widget slower to load. Instead resort to using the classical JavaScript methods for creating elements.</p>
<pre class="javascript" name="code">
document.write('
<div id="your_id"></div>

');
var widget = document.getElementById('you_id');
var div = document.createElement('div');
div.innerHTML = 'Hello World';
widget.appendChild(div);
</pre>
<p>You will have to load your data in from another source, and for this I recommend extending your API to give you a JavaScript variable followed by the JSON encoded data. Here&#8217;s an example from <a href="http://api.tweetmeme.com/popular.js?count=5&amp;category=all" target="_blank">tweetmeme</a>.</p>
<h4>Pitfalls</h4>
<p>There are a lot of difficulties involved in creating widgets and here are just a few of them:</p>
<ul>
<li>AJAX won’t work! You cannot post information between domains. </li>
<li>Don’t use a JavaScript framework - for a simple widget it’s is over kill. </li>
<li>Try to keep the requests down. These widgets are coming from your servers. </li>
<li>Anonymise the JavaScript, you don’t want it conflicting with other JavaScript. </li>
<li>Minimize your JavaScript. This will save on bandwidth for you, and make the widget faster to load.&#160; </li>
</ul>
<h4>Questions</h4>
<p>If you have any questions, or want to show off any widgets you have made please comment below.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a> <small>Halloween is just around the corner and what better to...</small></li><li><a href='http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/' rel='bookmark' title='Permanent Link: Designing For The iPhone'>Designing For The iPhone</a> <small> Yep, we have done it again, Tweetmeme has just...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dtsn?a=HV7V2KeZSgU:eIVPZO8IF2Y:IuXuQPol3sE"><img src="http://feeds.feedburner.com/~ff/dtsn?i=HV7V2KeZSgU:eIVPZO8IF2Y:IuXuQPol3sE" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=HV7V2KeZSgU:eIVPZO8IF2Y:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/dtsn?i=HV7V2KeZSgU:eIVPZO8IF2Y:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=HV7V2KeZSgU:eIVPZO8IF2Y:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/dtsn?i=HV7V2KeZSgU:eIVPZO8IF2Y:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/03/15/building-javascript-widgets/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing For The iPhone</title>
		<link>http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/</link>
		<comments>http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 21:08:16 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=470</guid>
		<description><![CDATA[
Yep, we have done it again, Tweetmeme has just landed another new feature, a mobile version specifically designed for the iPhone. How did we do&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/07/05/if-the-web-was-smaller-idea/' rel='bookmark' title='Permanent Link: If the web was smaller'>If the web was smaller</a> <small>I’ve just had this crazy idea, what would happen if...</small></li><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li><li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a> <small>Halloween is just around the corner and what better to...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2009/03/iphone.png" alt="designing for the iphone" /></p>
<p>Yep, we have done it again, <a href="http://tweetmeme.com">Tweetmeme</a> has just landed another new feature, a mobile version specifically designed for the iPhone. How did we do it? Well it’s really easy, and just like building a normal website but with a couple of extra snippets of code.</p>
<h4>The Design</h4>
<p>The hardest part of building a website specifically for the iPhone is coming up with the design. The screen real estate on the iPhone is very limited so you have to start by being creative. Focus on the content, components such as sidebars, large pictures and small text should be avoided, keep in mind that buttons should be <strong>big</strong>. </p>
<p>If you are using photoshop i have created a template for you to easily visualise your designs, which you can <a href="/wp-content/uploads/2009/03/iPhone_template.zip">download here</a>, based on the <a href="http://www.teehanlax.com/blog/?p=447">iPhone GUI PSD</a>, if you are not the set the canvas size of your design to <strong>320px width</strong> and <strong>480px height</strong>. Remember to images to a minimum and that the iPhone uses the <a href="http://webkit.org/">WebKit</a> rendering engine which supports some CSS3 tags, like rounded corners.</p>
<h4>The Code</h4>
<p>Lucky you are still dealing with a HTML page which uses HTML and CSS like any other webpage you may build.</p>
<pre class="html" name="code">
&lt;html&gt;
&lt;head&gt;
&#160;&#160;&#160; &lt;title&gt;My iPhone Page&lt;/title&gt;
&#160;&#160;&#160; &lt;meta name=&quot;viewport&quot; content=&quot;320; initial-scale=1.0; maximum-scale=1.0;&quot;&gt;
&#160;&#160;&#160; &lt;link rel=&quot;apple-touch-icon&quot; href=&quot;images/icon.png&quot;/&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Notice that line 4 and 5 include some magical meta tags which you may not of seen before. Line 3 sets the width of the viewport so it matches the screen width of the iPhone the second parameter sets the scale of the page.</p>
<p>Line 5 is for creating webclip icons when you bookmark a site. The image should be 57px by 57px in .png format. The iPhone adds the shine and the rounded corners.</p>
<h4>Redirect</h4>
<p>You want to redirect users on a iPhone to be redirected to the correct version. For this you will need a nice redirect script, normally detecting browser type based on user agent shouldn’t be done, you should detect browsers based on their capabilities.</p>
<pre class="javascript" name="code">
if ((navigator.userAgent.indexOf('iPhone') != -1) ||
(navigator.userAgent.indexOf('iPod') != -1)) {
document.location = "http://yoursite.com/iphone";
}
</pre>
<p>That&#8217;s it&#8217; really just buy added a couple of extra lines of HTML and a rejig of the design and CSS you can easily optimise your website for the iPhone.</p>
<h4>Notes</h4>
<p>There are a few things to remember when building a website for the iPhone:</p>
<ol>
<li>It’s a iPhone they are all the same, no multi browser checking, if it works in one it will work in them all! If only all web development was like this!</li>
<li>There is no :hover pseudo class in CSS</li>
<li>Keep images and JavaScript to a minimum, you don’t want to wait for ages for images/JavaScript to download.</li>
</ol>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/07/05/if-the-web-was-smaller-idea/' rel='bookmark' title='Permanent Link: If the web was smaller'>If the web was smaller</a> <small>I’ve just had this crazy idea, what would happen if...</small></li><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li><li><a href='http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/' rel='bookmark' title='Permanent Link: JavaScript Halloween Effects'>JavaScript Halloween Effects</a> <small>Halloween is just around the corner and what better to...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dtsn?a=PA8aUuCmKN8:ozct-Gd9mFw:IuXuQPol3sE"><img src="http://feeds.feedburner.com/~ff/dtsn?i=PA8aUuCmKN8:ozct-Gd9mFw:IuXuQPol3sE" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=PA8aUuCmKN8:ozct-Gd9mFw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/dtsn?i=PA8aUuCmKN8:ozct-Gd9mFw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=PA8aUuCmKN8:ozct-Gd9mFw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/dtsn?i=PA8aUuCmKN8:ozct-Gd9mFw:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Twestival</title>
		<link>http://dtsn.co.uk/2009/02/15/twestival/</link>
		<comments>http://dtsn.co.uk/2009/02/15/twestival/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 16:21:42 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/2009/02/15/twestival/</guid>
		<description><![CDATA[I would just like to say thank you to @RDGTwestival and @simonster for organising the Reading Twestival and say it was great meeting some of&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/' rel='bookmark' title='Permanent Link: Twitter T-Shirt Design'>Twitter T-Shirt Design</a> <small>Twestival is just around the corner (Feb. 12th) and I...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I would just like to say thank you to <a href="http://twitter.com/RDGTwestival" target="_blank">@RDGTwestival</a> and <a href="http://twitter.com/simonster" target="_blank">@simonster</a> for organising the <a href="http://reading.twestival.com" target="_blank">Reading Twestival</a> and say it was great meeting some of the local Twitter crowd, we should all do it again – how about Wednesday?</p>
<p> <span id="more-467"></span>
<p><a href="http://www.flickr.com/photos/jamin2/3276386479/" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://dtsn.co.uk/wp-content/uploads/2009/02/image2.png" width="478" height="317" /></a>     <br /><small>See <a href="http://twitter.com/benjaminellis" target="_blank">@BenjaminEllis</a> fab photo&#8217;s of RDGTwestival http://bit.ly/sLowO</small></p>
<p><strong>N.B.</strong> You can still buy the <a href="http://dtsn.spreadshirt.co.uk">T-shirts</a>.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/' rel='bookmark' title='Permanent Link: Twitter T-Shirt Design'>Twitter T-Shirt Design</a> <small>Twestival is just around the corner (Feb. 12th) and I...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/dtsn?a=JjRrL9DO"><img src="http://feeds.feedburner.com/~f/dtsn?i=JjRrL9DO" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/dtsn?a=TbTJsGuR"><img src="http://feeds.feedburner.com/~f/dtsn?i=TbTJsGuR" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/02/15/twestival/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tweetmeme Revamp</title>
		<link>http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/</link>
		<comments>http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 20:20:11 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/</guid>
		<description><![CDATA[Over the last couple of days we have been working hard at fav.or.it on a new design for tweetmeme. The old design wasn’t very nice&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2008/08/02/five-fantastic-colour-scheme-generators-design/' rel='bookmark' title='Permanent Link: Five Fantastic Colour Scheme Generators'>Five Fantastic Colour Scheme Generators</a> <small>Picking the colour scheme is one of the hardest aspects...</small></li><li><a href='http://dtsn.co.uk/2009/02/10/new-year-new-design/' rel='bookmark' title='Permanent Link: New Year, New Design'>New Year, New Design</a> <small>It has been a long time since I have touched...</small></li><li><a href='http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/' rel='bookmark' title='Permanent Link: Designing For The iPhone'>Designing For The iPhone</a> <small> Yep, we have done it again, Tweetmeme has just...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Over the last couple of days we have been working hard at <a href="http://fav.or.it">fav.or.it</a> on a new design for <a href="http://tweetmeme.com">tweetmeme</a>. The old design wasn’t very nice and lots of users were put off the site because of it’s garish colour scheme, but now we are back with, hopefully, a really successful new design.</p>
<p><strong>You can find a full review of the new features on the </strong><a href="http://blog.tweetmeme.com/2009/02/11/major-revamp/"><strong>tweetmeme blog</strong></a>.</p>
<p> <span id="more-459"></span>
<div align="center">
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/02/holding.gif"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="holding" border="0" alt="holding" src="http://dtsn.co.uk/wp-content/uploads/2009/02/holding-thumb.gif" width="363" height="236" /></a> </p>
</p></div>
<h4>Minimal</h4>
<p>Much like this website, Nick wanted the tweetmeme website to be really minimal and as far away from the old design as possible. A quick search on Kuler found the <a href="http://kuler.adobe.com/#themeID/193782">perfect colour scheme</a>. Combine that colour scheme with a few shades of grey and we have the perfect website.</p>
<h4>Rockwell</h4>
<p>You will notice that <a href="http://www.fonts.com/findfonts/detail.asp?pid=201908">Rockwel</a>l is used a lot around the website, i thought that the bold text contrasted really nicely with the small and minimal design.</p>
<h4>Feedback</h4>
<p>I am always interested in any feedback any can give me about my designs, so please leave feedback here, or on the tweetmeme blog.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2008/08/02/five-fantastic-colour-scheme-generators-design/' rel='bookmark' title='Permanent Link: Five Fantastic Colour Scheme Generators'>Five Fantastic Colour Scheme Generators</a> <small>Picking the colour scheme is one of the hardest aspects...</small></li><li><a href='http://dtsn.co.uk/2009/02/10/new-year-new-design/' rel='bookmark' title='Permanent Link: New Year, New Design'>New Year, New Design</a> <small>It has been a long time since I have touched...</small></li><li><a href='http://dtsn.co.uk/2009/02/25/designing-for-the-iphone/' rel='bookmark' title='Permanent Link: Designing For The iPhone'>Designing For The iPhone</a> <small> Yep, we have done it again, Tweetmeme has just...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/dtsn?a=ok3PyYmh"><img src="http://feeds.feedburner.com/~f/dtsn?i=ok3PyYmh" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/dtsn?a=lvHi3KqW"><img src="http://feeds.feedburner.com/~f/dtsn?i=lvHi3KqW" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Year, New Design</title>
		<link>http://dtsn.co.uk/2009/02/10/new-year-new-design/</link>
		<comments>http://dtsn.co.uk/2009/02/10/new-year-new-design/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 22:52:52 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[dtsn]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=451</guid>
		<description><![CDATA[It has been a long time since I have touched my personal blog. I have been preoccupied with other projects which mostly lead nowhere, i&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/' rel='bookmark' title='Permanent Link: Tweetmeme Revamp'>Tweetmeme Revamp</a> <small>Over the last couple of days we have been working...</small></li><li><a href='http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/' rel='bookmark' title='Permanent Link: Twitter T-Shirt Design'>Twitter T-Shirt Design</a> <small>Twestival is just around the corner (Feb. 12th) and I...</small></li><li><a href='http://dtsn.co.uk/2009/06/17/tweettabs-a-story/' rel='bookmark' title='Permanent Link: TweetTabs, A Story'>TweetTabs, A Story</a> <small>For everyone who follows me on twitter (@dtsn) or knows...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>It has been a long time since I have touched my personal blog. I have been preoccupied with other projects which mostly lead nowhere, i seem to have a strange passion to constantly redesign everything. Well my new years resolution is to <strong>stop</strong>! </p>
<p> <span id="more-451"></span>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/02/dtsn.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="dtsn" border="0" alt="dtsn" src="http://dtsn.co.uk/wp-content/uploads/2009/02/dtsn-thumb.png" width="476" height="503" /></a></p>
<h4>Welcome to dtsn v4</h4>
<p>This blog has seem a number of large changed throughout the years as I&#8217;ve improved my CSS/design skills the website has been updated. Well this is my latest design and hopefully i will always like it because it is simple, really simple.</p>
<p>For this design i am focusing on great content and great typography so nothing <strong>detracts from the content</strong>.</p>
<h4>Leave Feedback</h4>
<p>Please leave feedback on my new design, is it a bit too bare for you? Can you find the single image I am using in the entire design? Is there anything you would like to see?</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/11/tweetmeme-revamp/' rel='bookmark' title='Permanent Link: Tweetmeme Revamp'>Tweetmeme Revamp</a> <small>Over the last couple of days we have been working...</small></li><li><a href='http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/' rel='bookmark' title='Permanent Link: Twitter T-Shirt Design'>Twitter T-Shirt Design</a> <small>Twestival is just around the corner (Feb. 12th) and I...</small></li><li><a href='http://dtsn.co.uk/2009/06/17/tweettabs-a-story/' rel='bookmark' title='Permanent Link: TweetTabs, A Story'>TweetTabs, A Story</a> <small>For everyone who follows me on twitter (@dtsn) or knows...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/dtsn?a=xZG4dx3R"><img src="http://feeds.feedburner.com/~f/dtsn?i=xZG4dx3R" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/dtsn?a=WdCQXHQi"><img src="http://feeds.feedburner.com/~f/dtsn?i=WdCQXHQi" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/02/10/new-year-new-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Twitter T-Shirt Design</title>
		<link>http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/</link>
		<comments>http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 14:33:29 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/</guid>
		<description><![CDATA[Twestival is just around the corner (Feb. 12th) and I thought I would share the special T-shirt that I designed for the occasion. I wanted&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/15/twestival/' rel='bookmark' title='Permanent Link: Twestival'>Twestival</a> <small>I would just like to say thank you to @RDGTwestival...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://twestival.com">Twestival</a> is just around the corner (Feb. 12th) and I thought I would share the special T-shirt that I designed for the occasion. I wanted a T-shirt which I could put my own username on, but I was unable to find one, therefore I broke out illustrator and started designing.</p>
<p><span id="more-421"></span></p>
<p>I really wanted something that wasn’t in your face and was subtle, and preferably something that didn’t have the twitter logo on it. Therefore I chose a simple design using the original twitter bird, designed by Simon Oxley, available on <a href="http://www.istockphoto.com/file_closeup/concepts-and-ideas/time/2437874-blue-bird.php?id=2437874">iStockPhoto</a>, and a cloud to hold the name.</p>
<p>There were some modifications that had to be made to the vector images, firstly none of the lines could be two small and all the objects had to be converted so that none of their paths crossed.</p>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/02/tshirt.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="t-shirt" src="http://dtsn.co.uk/wp-content/uploads/2009/02/tshirt-thumb.png" border="0" alt="t-shirt" width="415" height="415" /></a></p>
<h4>Using SpreadShirt</h4>
<p><a href="http://spreadshirt.net">SpreadShirt</a> was chosen to print the T-Shirts because they accept vector drawings which allow for the most flexibility when it comes to colours, they allow up the 3 colours, but I would only be using two. The uploading process is really old tech, each vector drawing has to be approved by a human before they let you use it, but this process should takes less than 24 hours.</p>
<p>After the design has been approved the design can then be added to products, anything from T-shirts to umbrella’s can be printed with your design. I choose 2 different forms of T-shirt one a slim fit and one a normal fit, £14.50 and £14 respectively. You can then tweak around with the designs/colours/text to get your design perfect. I also converted mine into a product for my own store.</p>
<p>You can currently buy this T-shirt which will be printed with your name, in one of 7 colours at <a href="http://dtsn.spreadshirt.net">http://dtsn.spreadshirt.co.uk.</a></p>
<p><strong>N.B. The Slim-Fit Tee is really slim fit, leave a comment if you would like the design on any other products like girl tee&#8217;s, mugs, umbrella&#8217;s etc.</strong></p>
<p><a href="http://dtsn.co.uk/wp-content/uploads/2009/02/image.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" title="image" src="http://dtsn.co.uk/wp-content/uploads/2009/02/image-thumb.png" border="0" alt="image" width="230" height="305" /></a> <a href="http://dtsn.co.uk/wp-content/uploads/2009/02/tshirt2.jpg"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="t-shirt2" src="http://dtsn.co.uk/wp-content/uploads/2009/02/tshirt2-thumb.jpg" border="0" alt="t-shirt2" width="230" height="306" /></a></p>
<p><em>All the profits for this T-shirt will go to </em><a href="http://twestival.com"><em>Twestival</em></a><em>.</em></p>
<p><em>Roughly £1.40 - VAT will go to Twestival for every T-shirt brought, however spreadshirt will only release the money if more than 30 shirts are sold (thats just their store policy).</em></p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/02/15/twestival/' rel='bookmark' title='Permanent Link: Twestival'>Twestival</a> <small>I would just like to say thank you to @RDGTwestival...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/dtsn?a=RftSvFDs"><img src="http://feeds.feedburner.com/~f/dtsn?i=RftSvFDs" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/dtsn?a=yE4DYSWV"><img src="http://feeds.feedburner.com/~f/dtsn?i=yE4DYSWV" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2009/02/09/twitter-t-shirt-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Halloween Effects</title>
		<link>http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/</link>
		<comments>http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 22:40:00 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
		
		<category><![CDATA[CSS/HTML]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<category><![CDATA[Scriptaculous]]></category>

		<guid isPermaLink="false">http://dtsn.co.uk/?p=527</guid>
		<description><![CDATA[Halloween is just around the corner and what better to jazz your blog up than with some Halloween related JavaScript. This tutorial will focus on&#8230;


Related posts:<ol><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li><li><a href='http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/' rel='bookmark' title='Permanent Link: Super CSS, the power of the selector'>Super CSS, the power of the selector</a> <small>We all love CSS it’s fundamental to the web. However...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Halloween is just around the corner and what better to jazz your blog up than with some Halloween related JavaScript. This tutorial will focus on making images appear and disappear on the background of your blog.</p>
<p>For this example I will be using a ghost which will appear every two seconds in a random location and disappear again. You can preview what this will look like by clicking the button below (<em>only viewable in a web browser</em>).</p>
<p>You can download the source files for this tutorial below as well as the ghost AI file.</p>
<p><a href="/wp-content/uploads/2008/10/Ghost.zip">Source Files</a></p>
<p>For this tutorial we are going to be using <a onclick="javascript:pageTracker._trackPageview(&#39;/outgoing/script.aculo.us/&#39;);" href="http://script.aculo.us/">Script.aculo.us</a> effects library with the <a onclick="javascript:pageTracker._trackPageview(&#39;/outgoing/ww.prototypejs.org&#39;);" href="http://ww.prototypejs.org">Prototype</a> core framework.</p>
<pre class="javascript" name="code">var Ghost = Class.create({
	initialize: function() {
	}
});</pre>
<p>First of all we need to create our Class, which is called <em>Ghost</em>. Inside the class <em>Ghost</em> we have added our initialize function. The initialize function will be called when we create a new instance of the class. Therefore we need to put in all our setup code:</p>
<pre class="javascript" name="code"> // create the element
this.ghost = new Element('div', {'class' : 'ghost'});
// hide the element
this.ghost.hide();
// add the element to the body
$(document.body).insert({top: this.ghost});
// get the size of the document
this.size = document.viewport.getDimensions();
// set up the timer
new PeriodicalExecuter(this.show.bindAsEventListener(this), 2);</pre>
<p>In this segment we create our hidden ghost element. We then store the size of the document, and load up our periodical executer to call <em>this.show</em>. The second parameter in the Periodical Executer is the time between calls, we are calling the show function once every 2 seconds.</p>
<pre class="javascript" name="code">show: function() {
	// randomly set where the ghost is going
	var x = Math.floor(Math.random()*(this.size['width']-200));
	var y = Math.floor(Math.random()*(this.size['height']-200));
	// set the style
	this.ghost.setStyle({
		'left': x + 'px',
		'top': y + 'px'
	});

	// show the object
	this.ghost.appear({
		afterFinish: function() {
			this.ghost.fade();
		}.bind(this)
	});
}</pre>
<p>The show function needs to be added to the <em>Ghost</em> class. The show function first calculates where we want our ghost to appear, so we work out random x and y co-ordinates using the document sizes we gathered in our initialize function. We then position the element and call the <a onclick="javascript:pageTracker._trackPageview(&#39;/outgoing/script.aculo.us/&#39;);" href="http://script.aculo.us/">Script.aculo.us</a> appear effect which will slowly fade in the image. After the appear effect has finish we want to hide the ghost so we call fade.</p>
<p>Ok, now we have all the code complete we need to call the class. We can do this in a number of ways, you could bind the event to a button:</p>
<pre class="html" name="code">
<div onclick="new Ghost()">BOO</div>
</pre>
<p>Or you can bind it into your document load function, which means it will start when the page loads:</p>
<pre class="javascript" name="code">document.observe("dom:loaded", function() {
	new Ghost();
});</pre>
<h3>CSS</h3>
<p>The CSS is a really simple one line.</p>
<pre class="css" name="code">.ghost { width: 100px; height: 100px; position: absolute; background: url('yourimage.png') no-repeat; }</pre>
<p>This tutorial is just a brief outline with what you can do with JavaScript this Halloween. If you have any other ideas you would like me to implement, please tell me in the comments below.</p>


<p>Related posts:<ol><li><a href='http://dtsn.co.uk/2009/03/15/building-javascript-widgets/' rel='bookmark' title='Permanent Link: Building JavaScript Widgets'>Building JavaScript Widgets</a> <small> Little pieces of JavaScript you embed onto your website...</small></li><li><a href='http://dtsn.co.uk/2008/10/15/super-css-the-power-of-the-selector/' rel='bookmark' title='Permanent Link: Super CSS, the power of the selector'>Super CSS, the power of the selector</a> <small>We all love CSS it’s fundamental to the web. However...</small></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dtsn?a=uxrcC-w23Cw:-Gtws3OunxQ:IuXuQPol3sE"><img src="http://feeds.feedburner.com/~ff/dtsn?i=uxrcC-w23Cw:-Gtws3OunxQ:IuXuQPol3sE" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=uxrcC-w23Cw:-Gtws3OunxQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/dtsn?i=uxrcC-w23Cw:-Gtws3OunxQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dtsn?a=uxrcC-w23Cw:-Gtws3OunxQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/dtsn?i=uxrcC-w23Cw:-Gtws3OunxQ:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dtsn.co.uk/2008/10/26/javascript-halloween-effects/feed/</wfw:commentRss>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 1.746 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-07-03 06:05:50 -->
