<?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>Dr Nic &#187; Blogs</title>
	<atom:link href="http://drnicwilliams.com/category/blogs/feed/" rel="self" type="application/rss+xml" />
	<link>http://drnicwilliams.com</link>
	<description>Ruby makes Rails, Javascript makes Ajax, Dr Nic makes Magic</description>
	<lastBuildDate>Sat, 12 Nov 2011 01:05:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>One year on the InterTubes</title>
		<link>http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/</link>
		<comments>http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 09:01:14 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Essay]]></category>
		<category><![CDATA[Wish]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/</guid>
		<description><![CDATA[Dumping thoughts onto the InterTubes, aka blogging, is fun. And I&#8217;ve been doing it 1 year now. Its also challenging. Its like inviting people over for dinner &#8211; you have to clean up your house so they get a completely false impression of how you normally live your life. Same with code &#8211; pasting it [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2008/02/22/zero-sign-on-with-client-certificates/' rel='bookmark' title='Permanent Link: Zero Sign On &#8211; 1 better or Infinitely better than Single Sign On?'>Zero Sign On &#8211; 1 better or Infinitely better than Single Sign On?</a> <small>This article has no code in it. There are no...</small></li><li><a href='http://drnicwilliams.com/2007/07/20/one-app-one-user-account-and-multiple-openids/' rel='bookmark' title='Permanent Link: One App, One User Account and Multiple OpenIDs'>One App, One User Account and Multiple OpenIDs</a> <small>Summary: Its the future, and its not Facebook. Learn it....</small></li><li><a href='http://drnicwilliams.com/2007/07/03/openid-for-wordpress/' rel='bookmark' title='Permanent Link: OpenID for WordPress'>OpenID for WordPress</a> <small>This blog &#8211; nay, this InterTubes HomePage &#8211; runs on...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Dumping thoughts onto the InterTubes, aka blogging, is fun. And I&#8217;ve been doing it 1 year now.</p>
<p>Its also challenging.</p>
<p>Its like inviting people over for dinner &#8211; you have to clean up your house so they get a completely false impression of how you normally live your life. </p>
<p>Same with code &#8211; pasting it into blog articles or releasing projects makes you work harder to clean up code. </p>
<p>Same with the article &#8211; like rewriting paragraphs and sentences so they read better.</p>
<h3>Why?</h3>
<p>Remember the <a href="http://www.ihiredjeffclark.com/index2.html" title="I Hired Jeff Clark!  Jeff Clark is looking for a marketing job...">I Hired Jeff Clark</a> site from a year ago?</p>
<p>I started this blog a year ago with the idea of it being an Online CV &#8211; I&#8217;d write clever things, people would comment, and employers would pick me instead of <a href="http://www.pragmaticprogrammer.com/titles/mjwti/index.html" title="My Job Went to India">someone else</a>. </p>
<p><a class="imagelink" target="_blank" href="http://drnicwilliams.com/wp-content/maani/feedburner" title="Feedburner"><img id="image217" src="http://drnicwilliams.com/wp-content/uploads/2007/08/feedburner-drnic-12-mths.png" alt="Feedburner" /></a></p>
<caption><a target="_blank" href="http://drnicwilliams.com/wp-content/maani/feedburner">Click through</a> for fancy dynamic flash graph [<a href="#cgi-code">1</a>]</caption>
<h3>Leaving Tele2</h3>
<p>The whole time I&#8217;ve been overseas working for <a href="http://www.tele2.com">Tele2</a> &#8211; a Swedish telephone company, developing their billing systems. No Ruby code anywhere. Lots of perl, some Java, and lots of an internal proprietary language. It hurts to work on that environment.</p>
<p>And today is my last day, so now I can pursue Ruby/Rails with full-time reckless abandon. </p>
<p>Starting with <a href="http://drnicacademy.com">Dr Nic Academy</a>.</p>
<h3>What&#8217;s left to blog about?</h3>
<p>In the last 12 mths, I think I&#8217;ve covered a fair bit of (seemingly random) ground: <a href="http://drnicwilliams.com/category/ruby/ruby-on-rails/composite-keys/">composite keys</a>, <a href="http://drnicwilliams.com/category/ruby/ruby-on-rails/magic-models/">magic models</a>, <a href="http://drnicwilliams.com/category/javascript/">javascript</a>, <a href="http://drnicwilliams.com/category/radrails/">radrails fixups</a>, <a href="http://newgem.rubyforge.org">newgem</a>, and lately <a href="http://drnicwilliams.com/category/openid/">openid</a>.</p>
<p>In the future, the following stuff intrigues me, and it&#8217;d be fun to explore:</p>
<ol>
<li>Social OS &#8211; when I use flickr, I add contacts/friends/family and I add photos. When I visit <em>your</em> fancy new Web2.0 site, how can I import this profile information and automatically find all my friends or invite them to use your site? I envisage this built on OpenID, where every app is both an OpenID consumer (you login with OpenID) and possibly an OpenID provider (you can use your account page as a login to other apps).</li>
<li>Mongrel handlers &#8211; sexy integration of handlers into the Rails code base, so they are automatically picked up when the mongrel servers are started. I haven&#8217;t looked into this at all, so that sentence mightn&#8217;t make any sense.</li>
<li>Caching &#8211; nothing fancy, I just haven&#8217;t figured out how to use it yet. Anyone that used <a href="http://myconfplan.com">MyConfPlan</a> during RailsConf might have guessed this.</li>
<li>Javascript widget generator &#8211; generators get me from &#8220;idea&#8221; to &#8220;ooh that&#8217;s pretty&#8221; much faster, and avoid the &#8220;oh I can&#8217;t be bothered setting up the code base&#8221; step. I want to write a bunch of widgets for the <a href="http://rubyonrails.com.au">RoR Oceania blog</a>, to pull data from the <a href="http://faces.rubyonrails.com.au">RoR Oceania facebook</a> <a href="http://toolmantim.com/article/2007/8/3/i_can_has_faces_api">API</a>, so hopefully I can extract some base code into a generator.</li>
</ol>
<p>As always, I&#8217;m completely happy for someone else to tackle these things first. So get cracking <img src='http://drnicwilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a name="cgi-code"><br />
[1] The XML for this <a href="http://www.maani.us/">Maani graph</a> is mashed from the raw feedburner API via this <a href="http://pastie.caboo.se/84602">Ruby CGI script</a>. If you want to use it, you need to turn on the Feedburner API first, and change the start date within the code (currently set to 1/8/2006)</p>
<p>That is, the data goes from <a href="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=DrNic&#038;dates=2006-08-01,2007-08-01">feedburner XML</a> to <a href="http://drnicwilliams.com/cgi-bin/feedburner.cgi?url=DrNic">maani XML</a>.
<ol>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2008/02/22/zero-sign-on-with-client-certificates/' rel='bookmark' title='Permanent Link: Zero Sign On &#8211; 1 better or Infinitely better than Single Sign On?'>Zero Sign On &#8211; 1 better or Infinitely better than Single Sign On?</a> <small>This article has no code in it. There are no...</small></li><li><a href='http://drnicwilliams.com/2007/07/20/one-app-one-user-account-and-multiple-openids/' rel='bookmark' title='Permanent Link: One App, One User Account and Multiple OpenIDs'>One App, One User Account and Multiple OpenIDs</a> <small>Summary: Its the future, and its not Facebook. Learn it....</small></li><li><a href='http://drnicwilliams.com/2007/07/03/openid-for-wordpress/' rel='bookmark' title='Permanent Link: OpenID for WordPress'>OpenID for WordPress</a> <small>This blog &#8211; nay, this InterTubes HomePage &#8211; runs on...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>OpenID for WordPress</title>
		<link>http://drnicwilliams.com/2007/07/03/openid-for-wordpress/</link>
		<comments>http://drnicwilliams.com/2007/07/03/openid-for-wordpress/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 12:07:57 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Link]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2007/07/03/openid-for-wordpress/</guid>
		<description><![CDATA[This blog &#8211; nay, this InterTubes HomePage &#8211; runs on WordPress. This website allows you to comment. Like a blog. Let&#8217;s call it a blog. That&#8217;s shorter than &#8220;website&#8221;. To comment you&#8217;ve got to fill in your name and email and website every&#8230; single&#8230; time&#8230; Well, I don&#8217;t have to, because I have an account. [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/' rel='bookmark' title='Permanent Link: One year on the InterTubes'>One year on the InterTubes</a> <small>Dumping thoughts onto the InterTubes, aka blogging, is fun. And...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This blog &#8211; nay, this <em>InterTubes HomePage</em> &#8211; runs on WordPress.</p>
<p>This website allows you to comment. Like a blog. Let&#8217;s call it a blog. That&#8217;s shorter than &#8220;website&#8221;.</p>
<p>To comment you&#8217;ve got to fill in your name and email and website every&#8230; single&#8230; time&#8230; </p>
<p>Well, I don&#8217;t have to, because I have an account. </p>
<p>So I completely forgot about everyone else&#8217;s plight. That is, until one young soldier <a href="http://www.pinupgeek.com">Rodney Ramdas</a>, ask a good question:</p>
<blockquote><p>hey is there an openid enabled commenting thingy [for your blog]?</p></blockquote>
<p><a class="imagelink" href="http://openid.net/" title="OpenId logo"><img id="image206" src="http://drnicwilliams.com/wp-content/uploads/2007/07/openid-logo.gif" alt="OpenId logo" /></a></p>
<p>So I found <a href="http://verselogic.net/projects/wordpress/wordpress-openid-plugin/">OpenId plugin for WordPress</a>.</p>
<p>Now you can <a href="http://drnicwilliams.com/wp-login.php">create an account</a> on my site using OpenID and never have to fill all that crap in again.</p>
<p><strong>UPDATE:</strong> See comments below for how to use your blog domain name/url as your OpenID url. As it is this url that is appearing below people&#8217;s names, and that&#8217;s not what you want. That is, I can use <code>drnicwilliams.com</code> as my OpenID, even though it is actually <code>http://drnicwilliams.myopenid.com/</code>. </p>
<p>You can check that you&#8217;ve setup up your blog as your OpenID with <a href="http://www.openidenabled.com/resources/openid-test/diagnose-server/">this helper site</a>.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/' rel='bookmark' title='Permanent Link: One year on the InterTubes'>One year on the InterTubes</a> <small>Dumping thoughts onto the InterTubes, aka blogging, is fun. And...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2007/07/03/openid-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Fixing your Feedburner feeds</title>
		<link>http://drnicwilliams.com/2006/09/01/fixing-your-feedburner-feeds/</link>
		<comments>http://drnicwilliams.com/2006/09/01/fixing-your-feedburner-feeds/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 08:52:20 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2006/09/01/fixing-your-feedburner-feeds/</guid>
		<description><![CDATA[Feedburner is great &#8211; you get snazzy graphs [1]. And other stuff. People use your feedburner link, instead of your raw RSS feed, in their feed reader and Feedburner will track your number of subscribers. But it cannot track this information if your readers don&#8217;t use your Feedburner link. Why wouldn&#8217;t they use your Feedburner [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/' rel='bookmark' title='Permanent Link: One year on the InterTubes'>One year on the InterTubes</a> <small>Dumping thoughts onto the InterTubes, aka blogging, is fun. And...</small></li><li><a href='http://drnicwilliams.com/2007/07/03/openid-for-wordpress/' rel='bookmark' title='Permanent Link: OpenID for WordPress'>OpenID for WordPress</a> <small>This blog &#8211; nay, this InterTubes HomePage &#8211; runs on...</small></li><li><a href='http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/' rel='bookmark' title='Permanent Link: 8 steps for fixing other people&#8217;s code'>8 steps for fixing other people&#8217;s code</a> <small>Before or after you&#8217;re sharing your own code as open-source,...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.feedburner.com">Feedburner</a> is great &#8211; you get snazzy graphs <a href="#a1">[1]</a>. And other stuff. People use your feedburner link, instead of your raw RSS feed, in their feed reader and Feedburner will track your number of subscribers.</p>
<p>But it cannot track this information if your readers don&#8217;t use your Feedburner link. Why wouldn&#8217;t they use your Feedburner link? For two reasons:</p>
<ul>
<li>You haven&#8217;t included the link on your blog sidebar (most people do this correctly)</li>
<li>You haven&#8217;t replaced the RSS links in your blog header (most people stuff this up)</li>
</ul>
<p>Understand, there are two common ways for blog subscribers to add your site to their reader:</p>
<ul>
<li>Add the RSS feed &#8211; in this case, the Feedburner link you added to your sidebar, such as <a href="http://feeds.feedburner.com/DrNic">http://feeds.feedburner.com/DrNic</a></li>
<li>Add the site url &#8211; such as <a href="http://drnicwilliams.com">http://drnicwilliams.com</a></li>
</ul>
<p>Unfortunately for many bloggers, if your readers use the latter method and you haven&#8217;t fixed your header (shown below), then they will be signing up for the raw RSS feed, and you&#8217;ll be none the wiser about them. They&#8217;ll be an invisible subscriber and won&#8217;t make your graphs as tall as they should be.</p>
<p>Let&#8217;s take an example of a broken blog and fix it for him. But, you can&#8217;t actually tell him to fix it otherwise I&#8217;ll have to update my example. Ad infinitum. So, its mum&#8217;s the word, ok? Only 180  subscribers on this blog &#8211; statistically he&#8217;s not one of them. Shhhh.</p>
<p>Visit the <a href="http://www.pinupgeek.com/">pinupgeek.com</a> run by Rodney, where you&#8217;ll get weekly updates on the forum discussions of core improvements. On the right hand side, you&#8217;ll see the heading Subscribe and the RSS logo. The link under this logo is <a href="http://feeds.feedburner.com/pinupgeek">http://feeds.feedburner.com/pinupgeek</a> &#8211; a Feedburner link. So we know he wants people to use his Feedburner link so he can watch his pretty graphs.</p>
<p>Now, right click on the page, and select &#8220;View Page source&#8221;. Note that in the header you&#8217;ll see the following:</p>
<pre>
  &lt;link href="http://www.pinupgeek.com/xml/rss" rel="alternate" title="RSS" type="<span class="string">application/rss+xml</span>" /&gt;
</pre>
<p>This link, of type <code>application/rss+xml</code>, will be used by RSS readers around the world automagically when passed a blog url, instead of an RSS feed link.</p>
<p>Here&#8217;s what happens in Netvibes for Rodney&#8217;s site:</p>
<p><img src="http://drnicwilliams.com/wp-content/uploads/2006/09/incorrect-blog-header.PNG" alt="Blog headers providing incorrect RSS feed link" /></p>
<p>No Feedburner link, just the raw RSS link (and a RSD feed link &#8211; <em>what&#8217;s this for??</em>).</p>
<p>So, let&#8217;s fix Rodney&#8217;s site.</p>
<p>Replace the above link with the following (using your blog&#8217;s theme editor):</p>
<pre>
  &lt;link href="<span class="string">http://feeds.feedburner.com/pinupgeek</span>" rel="alternate" title="RSS" type="application/rss+xml" /&gt;
</pre>
<p>If Rodney did this, then when I added his site into my Netvibes reader &#8211; or any other reader &#8211; I would automatically pick up his Feedburner link, and not his raw, unmonitored links. </p>
<p>In other words, his graph will get bigger.</p>
<p><a name="a1">[1]</a> My blog is one month old and here is my Feedburner graph:</p>
<p><img src="http://drnicwilliams.com/wp-content/uploads/2006/09/feedburner-200608.PNG" alt="Feedburner - August 2006" /></p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2007/08/03/one-year-on-the-intertubes/' rel='bookmark' title='Permanent Link: One year on the InterTubes'>One year on the InterTubes</a> <small>Dumping thoughts onto the InterTubes, aka blogging, is fun. And...</small></li><li><a href='http://drnicwilliams.com/2007/07/03/openid-for-wordpress/' rel='bookmark' title='Permanent Link: OpenID for WordPress'>OpenID for WordPress</a> <small>This blog &#8211; nay, this InterTubes HomePage &#8211; runs on...</small></li><li><a href='http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/' rel='bookmark' title='Permanent Link: 8 steps for fixing other people&#8217;s code'>8 steps for fixing other people&#8217;s code</a> <small>Before or after you&#8217;re sharing your own code as open-source,...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2006/09/01/fixing-your-feedburner-feeds/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Translation of RSS feeds a failure (part 3)</title>
		<link>http://drnicwilliams.com/2006/08/30/translation-of-rss-feeds-a-failure/</link>
		<comments>http://drnicwilliams.com/2006/08/30/translation-of-rss-feeds-a-failure/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 12:11:19 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Blogs]]></category>
		<category><![CDATA[BTS]]></category>
		<category><![CDATA[Translation]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/30/translation-of-rss-feeds-a-failure/</guid>
		<description><![CDATA[My path to spying on the Japanese wouldn&#8217;t be complete without support for translating RSS feeds. The translation needs to be performed on the feed itself before it hits the feedreader (unless you have non-Ajaxy webreaders that you can translate). Unfortunately, Google Translate seems to ignore RSS altogether, and just redirects you back to the [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2006/09/01/fixing-your-feedburner-feeds/' rel='bookmark' title='Permanent Link: Fixing your Feedburner feeds'>Fixing your Feedburner feeds</a> <small>Feedburner is great &#8211; you get snazzy graphs [1]. And...</small></li><li><a href='http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/' rel='bookmark' title='Permanent Link: Foreign tourists to your websites (part 2)'>Foreign tourists to your websites (part 2)</a> <small>As a follow-up to the recent &#8220;Spy on the Japanese&#8221;...</small></li><li><a href='http://drnicwilliams.com/2006/08/29/ann-spy-on-the-japanese-rubists/' rel='bookmark' title='Permanent Link: [ANN] Spy on the Japanese Rubists'>[ANN] Spy on the Japanese Rubists</a> <small>Their Ruby code is surrounded by a shrouded of Japanese...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>My path to spying on the Japanese wouldn&#8217;t be complete without support for translating RSS feeds. The translation needs to be performed on the feed itself before it hits the feedreader (unless you have non-Ajaxy webreaders that you can translate).</p>
<p>Unfortunately, Google Translate seems to ignore RSS altogether, and just redirects you back to the original RSS feed.</p>
<p>For example, take sample feed: <a href="http://d.hatena.ne.jp/hanazukin/rss2">http://d.hatena.ne.jp/hanazukin/rss2</a></p>
<p>Press the Spy on Japanese bookmarklet (cheat: <a href="http://translate.google.com/translate?langpair=ja&#038;en&#038;hl=en&#038;ie=UTF-8&#038;oe=UTF-8&#038;u=http%3A%2F%2Fd.hatena.ne.jp%2Fhanazukin%2Frss2">click here for translation</a>) and you&#8217;ll see the original RSS feed in the lower frame. Its not that its been poorly translated &#8211; Google just redirects you back to the original page instead of translating it.</p>
<p>Two solutions:</p>
<ol>
<li>Use a HTML -> RSS feed converter and use the direct translation url (use translate_c? instead of translate? in the url)</li>
<li>Google Translate should add RSS feed translation. Really it cannot be more difficult than HTML translation. Add some caching (which google loves to do anyway) so its not translating each time my feed reader polls the feed, and you&#8217;re off and running.</li>
<li><strong>NEW</strong> &#8211; create a translator proxy that accepts RSS feed urls, converts the feed to a primitive HTML format, translate on google, convert results back to RSS feed
</ol>
<p>I prefer #2. So, if any Googlers read this blog, or if any friends of Larry &#038; Co. are reading this blog, or if anyone remotely interested in popping over to the Googleplex to pass on a message from me, could ask the Google Translate ppl to add RSS feed support, I&#8217;d be a very very happy man.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2006/09/01/fixing-your-feedburner-feeds/' rel='bookmark' title='Permanent Link: Fixing your Feedburner feeds'>Fixing your Feedburner feeds</a> <small>Feedburner is great &#8211; you get snazzy graphs [1]. And...</small></li><li><a href='http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/' rel='bookmark' title='Permanent Link: Foreign tourists to your websites (part 2)'>Foreign tourists to your websites (part 2)</a> <small>As a follow-up to the recent &#8220;Spy on the Japanese&#8221;...</small></li><li><a href='http://drnicwilliams.com/2006/08/29/ann-spy-on-the-japanese-rubists/' rel='bookmark' title='Permanent Link: [ANN] Spy on the Japanese Rubists'>[ANN] Spy on the Japanese Rubists</a> <small>Their Ruby code is surrounded by a shrouded of Japanese...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2006/08/30/translation-of-rss-feeds-a-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foreign tourists to your websites (part 2)</title>
		<link>http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/</link>
		<comments>http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 08:21:38 +0000</pubDate>
		<dc:creator>Dr Nic</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Translation]]></category>
		<category><![CDATA[Trick]]></category>

		<guid isPermaLink="false">http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/</guid>
		<description><![CDATA[As a follow-up to the recent &#8220;Spy on the Japanese&#8221; post, you might want a nice set of links for your visitors to translate your page sinto their language. But, here are your requirements (I can read your mind, I&#8217;m a doctor): You know what countries visit your site, so you want to configure it [...]


Related posts:<ol><li><a href='http://drnicwilliams.com/2008/12/21/migrating-project-websites-to-github-pages-with-sake-tasks-new-websites-with-jekyll_generator/' rel='bookmark' title='Permanent Link: Migrating project websites to github pages with sake tasks, new websites with jekyll_generator'>Migrating project websites to github pages with sake tasks, new websites with jekyll_generator</a> <small> Its almost Christmas time and that means presents. It...</small></li><li><a href='http://drnicwilliams.com/2006/11/21/diy-widgets/' rel='bookmark' title='Permanent Link: DIY widgets &#8211; How to embed your site on another site'>DIY widgets &#8211; How to embed your site on another site</a> <small>UPDATE: Demo and tutorial fixed for IE7. UPDATE: Opera-supporting code....</small></li><li><a href='http://drnicwilliams.com/2006/08/30/translation-of-rss-feeds-a-failure/' rel='bookmark' title='Permanent Link: Translation of RSS feeds a failure (part 3)'>Translation of RSS feeds a failure (part 3)</a> <small>My path to spying on the Japanese wouldn&#8217;t be complete...</small></li></ol>]]></description>
			<content:encoded><![CDATA[<p>As a follow-up to the recent &#8220;<a href="http://drnicwilliams.com/2006/08/29/ann-spy-on-the-japanese-rubists/">Spy on the Japanese</a>&#8221; post, you might want a nice set of links for your visitors to translate <em>your</em> page sinto their language. </p>
<p>But, here are your requirements (I can read your mind, I&#8217;m a doctor):</p>
<ul>
<li>You know what countries visit your site, so you want to configure it yourself.</li>
<li>Since it requires Javascript to be turned on for it to work, you don&#8217;t want the links to show if the visitor doesn&#8217;t.</li>
</ul>
<p>Solution: create the links using Javascript.</p>
<p>To allow translations of your blogs/websites via Google Translation, add the following inline Javascript into the sidebar. It was designed for WordPress &#8211; you may need to twiddle with the DOM elements created and/or CSS if it looks bad on your site.</p>
<p>The flags can be found at: <a href="http://www.famfamfam.com/lab/icons/flags/">http://www.famfamfam.com/lab/icons/flags/</a>, and I&#8217;ve assumed you&#8217;ll store the png images in the /images/flags/ folder. If you store them somewhere else, change the <code>images</code> variable at the top of the script.</p>
<p>So, paste this script into your sidebar and you are saying &#8220;Aliens Welcome Here&#8221; <a href="#a1">[1]</a>.</p>
<pre>
      &lt;script&gt;
        // Each lang in an array: [google lang code, flag name, language name]
        // Flags available at: http://www.famfamfam.com/lab/icons/flags/
        var to_langs  = [['ja', 'jp', 'Japanese'],
                         ['de', 'de', 'German'],
                         ['es', 'es', 'Spanish']];
        var from_lang = 'en';
        var images     = '/images/flags/';

        document.write("&lt;li id='translation'&gt;&lt;/li&gt;");
        var liDiv = document.getElementById('translation');
        var title = document.createElement("h2");
        title.appendChild(document.createTextNode("Translation"));
        liDiv.appendChild(title);
        var ulDiv = document.createElement("ul");
        liDiv.appendChild(ulDiv);
        for (var i=0; i < to_langs.length; i++) {
          var to_lang = to_langs[i][0];
          var flag    = to_langs[i][1];
          var name    = to_langs[i][2];
          liDiv = document.createElement('li');
          ulDiv.appendChild(liDiv);
          liDiv.innerHTML = "&lt;a href='#' onclick=\"location.href=" +
            "'http://translate.google.com/translate?langpair=" +
            from_lang + "&#038;" + to_lang + "&#038;hl=" + to_lang +
            "&#038;ie=UTF-8&#038;oe=UTF-8&#038;u='" +
            " + encodeURIComponent(location.href)\"&gt;" +
            "&lt;img border=0 src='" + images + flag + ".png' /&gt; " + name + "&lt;/a&gt;";
        }
        var getme = "&lt;a href='http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/'&gt;How to translate my site?&lt;/a&gt;";
        var getme_li = document.createElement("li");
        getme_li.innerHTML = getme;
        ulDiv.appendChild(getme_li);
      &lt;/script&gt;
</pre>
<p><a name="a1">[1]</a> Americans mightn't know that when foreigners visitor your country, we are presented with paperwork to fillout that refers to us as Aliens. Perhaps your government never watches its own Hollywood movies, but this isn't the best phrase to use, I think. Not very welcoming.</p>


<p>Related posts:<ol><li><a href='http://drnicwilliams.com/2008/12/21/migrating-project-websites-to-github-pages-with-sake-tasks-new-websites-with-jekyll_generator/' rel='bookmark' title='Permanent Link: Migrating project websites to github pages with sake tasks, new websites with jekyll_generator'>Migrating project websites to github pages with sake tasks, new websites with jekyll_generator</a> <small> Its almost Christmas time and that means presents. It...</small></li><li><a href='http://drnicwilliams.com/2006/11/21/diy-widgets/' rel='bookmark' title='Permanent Link: DIY widgets &#8211; How to embed your site on another site'>DIY widgets &#8211; How to embed your site on another site</a> <small>UPDATE: Demo and tutorial fixed for IE7. UPDATE: Opera-supporting code....</small></li><li><a href='http://drnicwilliams.com/2006/08/30/translation-of-rss-feeds-a-failure/' rel='bookmark' title='Permanent Link: Translation of RSS feeds a failure (part 3)'>Translation of RSS feeds a failure (part 3)</a> <small>My path to spying on the Japanese wouldn&#8217;t be complete...</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://drnicwilliams.com/2006/08/30/foreign-tourists-to-your-websites-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

