<?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>Pete Williams &#187; Code</title>
	<atom:link href="http://petewilliams.info/blog/category/web/code-web/feed/" rel="self" type="application/rss+xml" />
	<link>http://petewilliams.info/blog</link>
	<description>On Web Development and stuff</description>
	<lastBuildDate>Sun, 13 Jun 2010 19:19:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Display HTML OL/UL list as comma-separated sentence with CSS</title>
		<link>http://petewilliams.info/blog/2010/04/display-html-olul-list-as-comma-separated-sentence/</link>
		<comments>http://petewilliams.info/blog/2010/04/display-html-olul-list-as-comma-separated-sentence/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 22:56:15 +0000</pubDate>
		<dc:creator>Pete Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://petewilliams.info/blog/?p=438</guid>
		<description><![CDATA[On a site I&#8217;m currently working on, it seemed best to display an OL as a list in sentence form.
For example:

&#60;ul class="commaList"&#62;
	&#60;li&#62;one&#60;/li&#62;
	&#60;li&#62;two&#60;/li&#62;
	&#60;li&#62;three&#60;/li&#62;
	&#60;li&#62;four&#60;/li&#62;
&#60;/ul&#62;

Would display as: One, two, three and four.
In case this CSS is of any use to anyone else, I&#8217;ve published it as a snippet below.
Please note this uses pseudo-selectors and so will not work [...]]]></description>
			<content:encoded><![CDATA[<p>On a site I&#8217;m currently working on, it seemed best to display an OL as a list in sentence form.</p>
<p>For example:</p>
<pre class="code">
&lt;ul class="commaList"&gt;
	&lt;li&gt;one&lt;/li&gt;
	&lt;li&gt;two&lt;/li&gt;
	&lt;li&gt;three&lt;/li&gt;
	&lt;li&gt;four&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>Would display as: <em>One, two, three and four.</em></p>
<p>In case this CSS is of any use to anyone else, I&#8217;ve published it as a snippet below.</p>
<p>Please note this uses pseudo-selectors and so will not work in IE, but will gracefully degrade.</p>
<pre class="code">
/* display ordered list as comma list */
.commaList li:first-child {
	text-transform: capitalize;
}

.commaList li:after{
	content: ',';
	padding-right: 5px;
}

.commaList li:nth-last-child(2):after {
	content: '';
	padding-right: 5px;
}

.commaList li:last-child:before {
	content: 'and ';
	padding-right: 0;
}

.commaList li:last-child:after {
	content: '.';
	clear: both;
}

/* this prevents single item lists from containing commas and 'ands' */
.commaList li:only-of-type:before, .commaList li:only-of-type:after {
	content: '';
	padding: 0;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://petewilliams.info/blog/2010/04/display-html-olul-list-as-comma-separated-sentence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Amazon Link Localizer Greasemonkey Script</title>
		<link>http://petewilliams.info/blog/2009/09/amazon-link-localizer-greasemonkey-script/</link>
		<comments>http://petewilliams.info/blog/2009/09/amazon-link-localizer-greasemonkey-script/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 23:29:40 +0000</pubDate>
		<dc:creator>Pete Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[amazon.ca]]></category>
		<category><![CDATA[amazon.co.jp]]></category>
		<category><![CDATA[amazon.co.uk]]></category>
		<category><![CDATA[amazon.com]]></category>
		<category><![CDATA[amazon.de]]></category>
		<category><![CDATA[amazon.fr]]></category>
		<category><![CDATA[amazon.jp]]></category>
		<category><![CDATA[britain]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[canada]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[france]]></category>
		<category><![CDATA[germany]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[great britain]]></category>
		<category><![CDATA[international]]></category>
		<category><![CDATA[japan]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[localise]]></category>
		<category><![CDATA[localize]]></category>
		<category><![CDATA[nearest]]></category>
		<category><![CDATA[regional]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[uk]]></category>
		<category><![CDATA[united kingdom]]></category>
		<category><![CDATA[user script]]></category>

		<guid isPermaLink="false">http://petewilliams.info/blog/?p=379</guid>
		<description><![CDATA[This Greasemonkey script will convert links to international Amazon sites into links to your local Amazon site.
So if I link to a product on Amazon.co.uk, and you are a US visitor, you will get a link to that same product on Amazon.com instead.]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#suggest {
	display: none;
}
</style>
<p>This Greasemonkey script will convert links to international Amazon sites into links to your local Amazon site.<br />
So if I link to a product on Amazon.<span id="tldNot">co.uk</span>, you will get a link to that same product on Amazon.<span id="tld">com</span> instead.</p>
<p><a href="http://www.greasespot.net/">Greasemonkey</a> is an add-on for Firefox that allows you to run user-generated scripts on the websites you visit. If you haven&#8217;t got it yet, <a href="https://addons.mozilla.org/firefox/748/">download it now</a>, as you&#8217;ll need it to install the below script.</p>
<p>Once you&#8217;ve installed Greasemonkey, simply click the below link to install the script.</p>
<div id="suggest">
<p>As you&#8217;re visiting from <span id="country">US</span>, you&#8217;re probably looking for the Amazon.<span id="tld2">com</span> Script, right?</p>
<p><strong>Download</strong>: <a href="/files/gm/amazon.us.user.js" id="download" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.<span id="tld3">com</span> Link Localiser</a> (or <a href="" onclick="return showOptions()">see all options</a>)</p>
</div>
<div id="all_scripts">
Download the script for your local Amazon site:</p>
<ul>
<li><a href="/files/gm/amazon.ca.user.js" id="ca" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.ca Link Localiser</a></li>
<li><a href="/files/gm/amazon.co.uk.user.js" id="uk" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.co.uk Link Localiser</a></li>
<li><a href="/files/gm/amazon.com.user.js" id="us" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.com Link Localiser</a></li>
<li><a href="/files/gm/amazon.de.user.js" id="de" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.de Link Localiser</a></li>
<li><a href="/files/gm/amazon.fr.user.js" id="fr" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.fr Link Localiser</a></li>
<li><a href="/files/gm/amazon.jp.user.js" id="jp" onclick="pageTracker._trackPageview( 'download_amzn_gm_script' );">Amazon.jp Link Localiser</a></li>
</ul>
</div>
<h3>Updates</h3>
<p><a href="http://twitter.com/PeteWilliams">Follow me on Twitter</a> to be sure you hear about new updates.</p>
<p><script type="text/javascript" src="http://js.petewilliams.info/gm.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://petewilliams.info/blog/2009/09/amazon-link-localizer-greasemonkey-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon Affiliate Link Localizer Wordpress Plugin</title>
		<link>http://petewilliams.info/blog/2009/09/amazon-affiliate-link-localizer-wordpress-plugin/</link>
		<comments>http://petewilliams.info/blog/2009/09/amazon-affiliate-link-localizer-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 06:44:41 +0000</pubDate>
		<dc:creator>Pete Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[affiliate]]></category>
		<category><![CDATA[affiliate marketing]]></category>
		<category><![CDATA[affiliates]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[amazon.ca]]></category>
		<category><![CDATA[amazon.co.jp]]></category>
		<category><![CDATA[amazon.co.uk]]></category>
		<category><![CDATA[amazon.com]]></category>
		<category><![CDATA[amazon.de]]></category>
		<category><![CDATA[amazon.fr]]></category>
		<category><![CDATA[amazon.jp]]></category>
		<category><![CDATA[associate]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[improve referrals]]></category>
		<category><![CDATA[improve sales]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[referral]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[weblog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://petewilliams.info/blog/?p=366</guid>
		<description><![CDATA[This Wordpress plugin changes any Amazon links on your site to use your affiliate ID. It also changes the link to point to the user's local Amazon store.

So if your visitor is visiting form the UK they'll get a link to Amazon.co.uk, if they're visiting from the US they'll get a link to the same product on Amazon.com.]]></description>
			<content:encoded><![CDATA[<h3>Download</h3>
<p>Current Version: <a href="http://wordpress.org/extend/plugins/amazon-affiliate-link-localizer/">Amazon Affiliate Link Localizer 1.3</a><br />
Last Updated: 27/11/2009</p>
<h3>Description</h3>
<p>This plugin not only automatically changes any Amazon link on your site to use your affiliate ID, but it also changes the link to point to the user&#8217;s local Amazon store. </p>
<p>So if your visitor is visiting from the UK they&#8217;ll get a link to Amazon.co.uk, if they&#8217;re visiting from the US they&#8217;ll get a link to the same product on Amazon.com.</p>
<p>All you have to do is provide all your affiliate IDs!</p>
<h3>Non-Wordpress version</h3>
<p>If you want to achieve the same result on a non-Wordpress site, you can simply install the <a href="http://petewilliams.info/blog/2009/07/javascript-amazon-associate-link-localiser/">pure JavaScript version</a>. </p>
<h3>See also: Greasemonkey Script</h3>
<p>As an Amazon user, you may also be interested in my <a href="/blog/2009/09/amazon-link-localizer-greasemonkey-script/">Amazon Link Localizer Greasemonkey Script</a> which automatically converts links to international Amazon sites into links to your local Amazon site.</p>
<p>So if I link to a product on Amazon.co.uk, and you are a US visitor, you will get a link to that same product on Amazon.com instead.</p>
<h3>Updates</h3>
<p><a href="http://twitter.com/PeteWilliams">Follow me on Twitter</a> to be sure you hear about new updates.</p>
<h3>Disclosure</h3>
<p>If you do not insert your own affiliate IDs the script will use mine. Hopefully this will help fund my book addiction!</p>
]]></content:encoded>
			<wfw:commentRss>http://petewilliams.info/blog/2009/09/amazon-affiliate-link-localizer-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>JavaScript Amazon Associate Link Localiser</title>
		<link>http://petewilliams.info/blog/2009/07/javascript-amazon-associate-link-localiser/</link>
		<comments>http://petewilliams.info/blog/2009/07/javascript-amazon-associate-link-localiser/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 22:26:10 +0000</pubDate>
		<dc:creator>Pete Williams</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[affiliate]]></category>
		<category><![CDATA[affiliate marketing]]></category>
		<category><![CDATA[affiliates]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[associate]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[improve referrals]]></category>
		<category><![CDATA[improve sales]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[referral]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://petewilliams.info/blog/?p=214</guid>
		<description><![CDATA[This script ensures that your Amazon links take your international visitors to their local Amazon site, rather than yours! You'll never lose a referral sale again, as the script automatically inserts your Amazon Associate ID for the appropriate international Amazon site.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a member of <a href="https://affiliate-program.amazon.co.uk/">Amazon&#8217;s Associate program</a> for a number of years and have posted affiliate links to books discussed on this very blog. The program means that by putting my affiliate ID into any links to Amazon products, I receive a small referral fee.</p>
<p>I&#8217;ve always linked to <a href="http://www.amazon.co.uk/exec/obidos/redirect-home/pcrev05">Amazon.co.uk</a> as that&#8217;s my local Amazon store, but of course that&#8217;s not necessarily true for my visitors &#8211; or yours&#8230;</p>
<p>To solve this problem, I&#8217;ve written some JavaScript which will convert any Amazon product links on your page into affiliated links to your visitor&#8217;s local Amazon store. So US visitors will get a .com link, whilst UK visitors will get a .co.uk link to the same product.</p>
<h3>Download</h3>
<ul>
<li><a href="http://petewilliams.info/dl.php?strFile=js/amazon.js" onclick="pageTracker._trackPageview( 'amazon.js' );">amazon.js</a> (2 kb)</li>
<li><a href="http://petewilliams.info/dl.php?strFile=js/amazon.min.js" onclick="pageTracker._trackPageview( 'amazon.min.js' );">amazon.min.js</a> compressed (1 kb)</li>
</ul>
<h3>Setup</h3>
<p>Edit amazon.js to insert your regional Associate IDs into the array at the top, for example:</p>
<pre class="code">
var arrAffiliates = {
	'co.uk' : 'petewill-19',
	'com'	: 'petewill-20',
	'de'	: 'petewill05-21',
	'fr'	: 'petewill-21',
	'ca'	: 'petewill00-20',
	'jp'	: ''
}
</pre>
<p>If you do not have an ID for each country, you can just leave them blank, as above for .jp.</p>
<h3>Upload and Embed</h3>
<p>As well as linking to amazon.js you need to link to the Google JS API file (5 kb) or the script will not work. Insert the following code just before your &lt;/body&gt; tag:</p>
<pre class="code">
&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="amazon.min.js"&gt;&lt;/script&gt;
</pre>
<p>Upload your modified amazon.js file, and make sure the above link points to the right location.</p>
<h3>Usage</h3>
<p>That&#8217;s it. You&#8217;re done! You can now just link to any product on any Amazon site with a normal, unaffiliated link and your users will get one affiliated for their country.</p>
<h3>Example</h3>
<p>The script is running on this page, so hopefully <a href="http://www.amazon.co.uk/Dont-Make-Me-Think-Usability/dp/0321344758/">this example</a> should be affiliated specially for you!</p>
<h3>Updates</h3>
<p><a href="http://twitter.com/PeteWilliams">Follow me on Twitter</a> to be sure you hear about new updates.</p>
<h3>Disclosure</h3>
<p>If you do not insert your own affiliate IDs the script will use mine. Hopefully this will help fund my book addiction!</p>
]]></content:encoded>
			<wfw:commentRss>http://petewilliams.info/blog/2009/07/javascript-amazon-associate-link-localiser/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
