<?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>Alex James Brown</title>
	<atom:link href="http://www.alexjamesbrown.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexjamesbrown.com</link>
	<description>My Words. By Me.</description>
	<lastBuildDate>Thu, 10 May 2012 10:39:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Node RailwayJS app &#8211; Deploying to Heroku &#8211; ENOENT, open &#8216;/app/log/production.log</title>
		<link>http://www.alexjamesbrown.com/development/node-railwayjs-app-deploying-to-heroku/</link>
		<comments>http://www.alexjamesbrown.com/development/node-railwayjs-app-deploying-to-heroku/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 22:48:31 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=850</guid>
		<description><![CDATA[I&#8217;m currently working on a project involving a node.js app, using RailwayJS, deploying to Heroku. After doing my git push Heroku Everything seemed ok, however, the app was not running. ...]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Arial;">I&#8217;m currently working on a project involving a node.js app, using <a href="http://www.railwayjs.com">RailwayJS</a>, deploying to Heroku.</span></p>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">After doing my</p>
<blockquote>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">git push Heroku</p>
</blockquote>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">Everything seemed ok, however, the app was not running.</p>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">I ran Heroku logs and was shown:</p>
<blockquote><p>app[web.1]: listening on port 32168 within production environment<br />
app[web.1]:<br />
app[web.1]: events.js:48<br />
app[web.1]: throw arguments[1]; // Unhandled &#8216;error&#8217; event<br />
app[web.1]: ^<br />
app[web.1]: Error: ENOENT, open &#8216;/app/log/production.log&#8217;<br />
heroku[web.1]: Process exited with status 1<br />
heroku[web.1]: State changed from starting to crashed</p></blockquote>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">This didn&#8217;t tell me much, apart from</p>
<blockquote>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">ENOENT, open &#8216;/app/log/production.log&#8217;</p>
</blockquote>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">This means that the file specified can&#8217;t be found- or opened in our case.</p>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">To resolve this, after suggestion from RailwayJS&#8217; extremely helpful creator, Anatoliy Chakkaev, I simply disabled quiet logging, by changing my environment config to:</p>
<blockquote>
<p style="margin-top: 0px; margin-bottom: 0px; font-family: Arial;">app.disable(&#8216;quiet&#8217;);</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/development/node-railwayjs-app-deploying-to-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple store rip off</title>
		<link>http://www.alexjamesbrown.com/gadgets-and-hardware/apple-store-rip-off/</link>
		<comments>http://www.alexjamesbrown.com/gadgets-and-hardware/apple-store-rip-off/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 12:53:28 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Gadgets / Hardware]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=840</guid>
		<description><![CDATA[Same product $49.95 on the US Apple store, £69.95 on the UK store]]></description>
			<content:encoded><![CDATA[<p>Same product</p>
<p>$49.95 on the US Apple store, £69.95 on the UK store</p>
<p><img title="mac-stand-us-uk-store.jpg" src="http://www.alexjamesbrown.com/wp-content/uploads/mac-stand-us-uk-store.jpg" border="0" alt="Price comparison between UK and US Apple Store" width="600" height="272" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/gadgets-and-hardware/apple-store-rip-off/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Homebrew &#8211; You have no /usr/bin/cc (Xcode)</title>
		<link>http://www.alexjamesbrown.com/development/fix-homebrew-you-have-no-usrbincc-xcode/</link>
		<comments>http://www.alexjamesbrown.com/development/fix-homebrew-you-have-no-usrbincc-xcode/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 15:48:52 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=829</guid>
		<description><![CDATA[I recently did a fresh install of OS X Lion on my Macbook Pro I installed XCode, homebrew, and git. After trying to install mysql via homebrew: brew install mysql ...]]></description>
			<content:encoded><![CDATA[<p>I recently did a fresh install of OS X Lion on my Macbook Pro</p>
<p>I installed XCode, homebrew, and git.</p>
<p>After trying to install mysql via homebrew:</p>
<pre>brew install mysql</pre>
<p>I received this error:</p>
<blockquote><p>Error: Failed executing: ./configure &#8211;prefix=/usr/local/Cellar/readline/6.2.2 &#8211;mandir=/usr/local/Cellar/readline/6.2.2/share/man &#8211;infodir=/usr/local/Cellar/readline/6.2.2/share/info &#8211;enable-multibyte<br />
If `brew doctor&#8217; does not help diagnose the issue, please report the bug:</p>
<p>https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue</p></blockquote>
<p>So, I did what I was told, and ran:</p>
<pre>brew doctor</pre>
<p>This returned:</p>
<blockquote><p>You have no /usr/bin/cc. This will cause numerous build issues. Please<br />
reinstall Xcode.</p></blockquote>
<p>But, Xcode <em>is</em> installed<br />
After some googling (which if you&#8217;re reading this, you&#8217;ll notice there&#8217;s not a lot of results), I found the solution.</p>
<p>Xcode needs the Command line tools installed.</p>
<p>To do this, open Xcode, click the Xcode menu, and select preferences.<br />
Click install next to Command line tools:</p>
<p><a href="http://alexjamesbrown.com.s3.amazonaws.com/wp-content/uploads/xcode-install-command-line-tools.jpg"><img class="alignleft size-medium wp-image-832" title="xcode-install-command-line-tools" src="http://alexjamesbrown.com.s3.amazonaws.com/wp-content/uploads/xcode-install-command-line-tools-300x217.jpg" alt="" width="300" height="217" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/development/fix-homebrew-you-have-no-usrbincc-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Onavo removes Personal Hotspot option on Three</title>
		<link>http://www.alexjamesbrown.com/gadgets-and-hardware/installing-onavo-removes-personal-hotspot-option-on-three/</link>
		<comments>http://www.alexjamesbrown.com/gadgets-and-hardware/installing-onavo-removes-personal-hotspot-option-on-three/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 00:58:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Gadgets / Hardware]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=824</guid>
		<description><![CDATA[I tend to use the personal hotspot (tethering) feature on my iPhone every week or so (while out at meetings, it&#8217;s handy to connect laptop if there&#8217;s no wifi available) ...]]></description>
			<content:encoded><![CDATA[<p>I tend to use the personal hotspot (tethering) feature on my iPhone every week or so (while out at meetings, it&#8217;s handy to connect laptop if there&#8217;s no wifi available)</p>
<p>Recently, I stumbled across Onavo</p>
<p>Essentially this compresses mobile data before it&#8217;s sent to your device, to reduce your data usage, and speed up your browsing etc&#8230;</p>
<p>I installed the app, and it creates a profile on your phone, to point your connection</p>
<p>It does this by installing a configuration profile that overrides your normal Carrier&#8217;s APN settings, redirecting traffic through its AWS based cloud. There, the assets are downloaded using inexpensive wired access, evaluated and compressed, before being sent on to the Carrier (in my case, Three) &#8211; compressed.</p>
<p>However…<br />
After a couple of weeks of using it, I noticed my personal Hotspot option had suddenly disappeared.<br />
I was outraged.<br />
Immediately, I thought Three had taken it away from my package, and tweeted them accordingly&#8230;</p>
<p>Three assured me this wasn&#8217;t the case….</p>
<p>So I did some thinking, and remembered Onavo.</p>
<p>I uninstalled the app using this method, restarted the phone, and voila!<br />
My personal hotspot option is back!</p>
<p>Seems this isn&#8217;t just limited to the Three network, nor do I seem to be the only one, according to their support page:</p>
<p>http://getsatisfaction.com/onavo/topics/my_personal_hotspot_configuration_has_gone</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/gadgets-and-hardware/installing-onavo-removes-personal-hotspot-option-on-three/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>British Gas Energy Smart monitor &#8211; Screen looks strange</title>
		<link>http://www.alexjamesbrown.com/misc/british-gas-energy-smart-monitor-screen-looks-strange/</link>
		<comments>http://www.alexjamesbrown.com/misc/british-gas-energy-smart-monitor-screen-looks-strange/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 13:00:09 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=807</guid>
		<description><![CDATA[I recently signed up to British Gas energy smart tariff for gas and electricity, which comes with a handy meter that tells me how much electricity I’m using. Once I’d ...]]></description>
			<content:encoded><![CDATA[<p>I recently signed up to British Gas energy smart tariff for gas and electricity, which comes with a handy meter that tells me how much electricity I’m using.</p>
<p>Once I’d plugged the unit in, i noticed the screen looked a little bit strange… almost, like it was flickering.</p>
<p>I could only detect this if i moved my eyes left or right, up or down… It was almost like the 3 colours (Red Green, and Blue) that make up the screen were refreshing somewhat slowly…</p>
<p><a href="http://www.alexjamesbrown.com/wp-content/uploads/British-Gas-Energy-Smart_C339/IMG_1624.jpg" target="_blank"><img style="display: inline" title="Energy Smart Meter" alt="Energy Smart Meter" src="http://www.alexjamesbrown.com/wp-content/uploads/British-Gas-Energy-Smart_C339/IMG_1624_thumb.jpg" width="450" height="336" /></a></p>
<p><a href="http://www.alexjamesbrown.com/wp-content/uploads/British-Gas-Energy-Smart_C339/IMG_1623.jpg" target="_blank"><img style="display: inline" title="Energy Smart Meter - Moving" alt="Energy Smart Meter - Moving - see colours &quot;split&quot;" src="http://www.alexjamesbrown.com/wp-content/uploads/British-Gas-Energy-Smart_C339/IMG_1623_thumb.jpg" width="450" height="603" /></a></p>
<p><a href="http://www.alexjamesbrown.com/wp-content/uploads/British-Gas-Energy-Smart_C339/IMG_1622.jpg" target="_blank"><img style="display: inline" title="Energy Smart Meter - Moving" alt="Energy Smart Meter - Moving - see colours &quot;split&quot;" src="http://www.alexjamesbrown.com/wp-content/uploads/British-Gas-Energy-Smart_C339/IMG_1622_thumb.jpg" width="450" height="603" /></a></p>
<p>Kind of a pointless post, but I thought I’d share it anyway….</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/misc/british-gas-energy-smart-monitor-screen-looks-strange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review of nightmare with Elance provider (WebHouse)</title>
		<link>http://www.alexjamesbrown.com/development/review-of-nightmare-with-elance-provider-webhouse/</link>
		<comments>http://www.alexjamesbrown.com/development/review-of-nightmare-with-elance-provider-webhouse/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 13:19:00 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[elance]]></category>
		<category><![CDATA[outsourcing]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=793</guid>
		<description><![CDATA[I’ve used eLance for various outsourcing projects for a number of years. (Great for small tasks, and an extra pair of hands until the 25th hour in a day is ...]]></description>
			<content:encoded><![CDATA[<p>I’ve used eLance for various outsourcing projects for a number of years.    <br />(Great for small tasks, and an extra pair of hands until the 25th hour in a day is discovered!)</p>
<p>Sure, I’ve had my fair share of problems, however, all have been amicably resolved, talking with eLance and the contractor.</p>
<h3>WebHouse   <br />(Md. Zakir Hossain Dakua)    <br /></h3>
<p>Recently, I had a small requirement for a WordPress theme to be slightly customised.    <br />Unfortunately, I was heading off on holiday, so needed to outsource it, to meet my clients timescale.</p>
<p>I posted the job up on eLance, and had the usual 30 or so bids.</p>
<p><img style="margin: 0px 20px 0px 0px; display: inline; float: left" align="left" src="http://ws.elance.com/php/files/main/download.php?crypted=Y3R4JTNEcHJvZmlsZV9pbWFnZSUyNmZpZCUzRDI4MDY1NTExJTI2cmlkJTNELTElMjZwaWQlM0QyNDQ5ODE2JTI2dCUzRDI=" /></p>
<p>One of those, was from WebHouse (Zak D.), from Shabujbag, Dhaka, Bangladesh.   <br />Real name &#8211; Md. Zakir Hossain Dakua.    <br />Just in case you’ve had contact from him directly, his email address is:     <br />zakirdaq@gmail.com    </p>
<p>I’m usually pretty good at spotting the “bulls*t” in the initial communication <em>(typically, they’ll just say “yes” to everything&quot;)</em></p>
<p>The fixed price work was completed, and he immediately began pressuring me to release the escrow.    <br />He also changed the job to “complete” which meant escrow would auto-release.</p>
<p>Due to my holiday, I didn’t have chance to review the code, was just able to check the basic functionality.</p>
<p>Later, when more data had been added, it was apparent there was a problem with his code.    <br />I asked to get him to fix his own bugs, and here is where the problems started.</p>
<h3>A contractor can create a job on your behalf!</h3>
<p>On eLance a contractor can create a paid hourly job on your behalf, without you authorising it!    <br />This is what happened. I asked him repeatedly to tell me how long in hours, it would take (and therefore how much) Obviously I got no reply.</p>
<p>WebHouse offered no reply, until he submitted a time-sheet for over 7 hours (at $20/hour) to fix these bugs.</p>
<p>I rejected this, however, but, was on vacation when the “review period” deadline was.</p>
<p>I had emailed eLance to state that I do not authorise them to charge my card.    <br />Heck, I even cancelled my credit card before I went!</p>
<p>However, eLance ignored all of this, and charged my card anyway (damn pre-authorisation must of kicked in!)</p>
<p>Since then, I’ve had nothing but bad news from eLance support who refuse to help.</p>
<p>But why should they? They get their 10% commission from the $150 odd I have been scammed by.    <br />They claim that their “WorkView” process is bullet proof, and that I could review the screenshots… etc…     <br />This is all true, but the work he was doing, was to fix bugs <strong>he</strong> had created, on work that had already been paid for!     </p>
<p>WebHouse has been very unhelpful, right from the start of my dispute.    <br />Stating that the work was done, it was quality work etc…     <br />He even started getting rude, calling me “mad” for doubting the quality of his work (all in hard to decipher, broken English)</p>
<p>I’m using this blog post to drive home how poor his work really was!</p>
<p>I just hope a prospective client stumbles across this post, and choses to decline his bid, before being let down in a similar way to me!</p>
<h2>Resolution</h2>
<p>Elance finally agreed (after many emails) that there was a problem with the way WebHouse worked.    <br />Although, unfortunately, they wouldn’t take the money back off him, they did credit me with $75.</p>
<p>So, moral of the story, I guess:    <br />Don’t use eLance WorkView, or eLance at all for that matter!     <br />I’ve since moved to oDesk. Far more reliable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/development/review-of-nightmare-with-elance-provider-webhouse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Carplan &#8211; Kleen Air review</title>
		<link>http://www.alexjamesbrown.com/personal/carplan-kleen-air-review/</link>
		<comments>http://www.alexjamesbrown.com/personal/carplan-kleen-air-review/#comments</comments>
		<pubDate>Mon, 23 May 2011 13:06:00 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=790</guid>
		<description><![CDATA[I have a BMW 330d (E46 – 2005) About a year ago, I noticed that if I turned off the Aircon (but left the fan running), a musty, damp smell ...]]></description>
			<content:encoded><![CDATA[<p>I have a BMW 330d (E46 – 2005)   <br />About a year ago, I noticed that if I turned off the Aircon (but left the fan running), a musty, damp smell would seep through the vents, filling the car with unpleasant aroma.</p>
<p>This meant that I either had to have the Aircon running all the time, or be too hot.</p>
<p>After some google searching of similar problems, I bought a can of Carplan Kleen Air from eBay (£6.95 delivered)</p>
<p>Following the simple instructions on the can, I left the can discharging for around 10-15 minutes, with the aircon on re-circulate.   <br />After this time, I took the (now empty) can out, and turned the aircon off.</p>
<p>Driving home later, I noticed that the once damp, musty smell had almost disappeared!</p>
<p>I think I’ll repeat the process once more (buying another can soon) just to get rid of the last of the smells.</p>
<p><strong>Update</strong></p>
<p>A couple of weeks later, the smell is still better than it once was, however is returning.   <br />Will repeat the process at the end of the summer, and see how it goes then!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/personal/carplan-kleen-air-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JoeBlogs wrapper moved to GitHub</title>
		<link>http://www.alexjamesbrown.com/development/joeblogs-wrapper-moved-to-github/</link>
		<comments>http://www.alexjamesbrown.com/development/joeblogs-wrapper-moved-to-github/#comments</comments>
		<pubDate>Thu, 05 May 2011 22:51:01 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JoeBlogs]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/development/joeblogs-wrapper-moved-to-github/</guid>
		<description><![CDATA[Following from my plea for help for JoeBlogs I finally got round to learning Git. The project has now been moved to GitHub: http://www.github.com/alexjamesbrown/joeblogs I will eventually move the Wiki ...]]></description>
			<content:encoded><![CDATA[<p>Following from my <a href="http://www.alexjamesbrown.com/development/joe-blogs-wrapper-v2-help-required/" target="_blank">plea for help for JoeBlogs</a> I finally got round to learning Git.</p>
<p>The project has now been moved to GitHub:   <br /><a href="http://www.github.com/alexjamesbrown/joeblogs">http://www.github.com/alexjamesbrown/joeblogs</a></p>
<p>I will eventually move the Wiki / Docs to the page also.</p>
<p>If anyone would like to become a contributor, please contact me on GitHub</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/development/joeblogs-wrapper-moved-to-github/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dell Latitude E5500 &#8211; Windows was unable to connect to &lt;network name&gt;</title>
		<link>http://www.alexjamesbrown.com/gadgets-and-hardware/dell-latitude-e5500-windows-was-unable-to-connect-to-network-name/</link>
		<comments>http://www.alexjamesbrown.com/gadgets-and-hardware/dell-latitude-e5500-windows-was-unable-to-connect-to-network-name/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 17:12:27 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Gadgets / Hardware]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/gadgets-and-hardware/dell-latitude-e5500-windows-was-unable-to-connect-to-network-name/</guid>
		<description><![CDATA[Having taken delivery of a new E5500, we configured the machine (not that it took much effort, as it came with none of the usual “crap” that is pre-installed&#34;) and ...]]></description>
			<content:encoded><![CDATA[<p>Having taken delivery of a new E5500, we configured the machine (not that it took much effort, as it came with none of the usual “crap” that is pre-installed&quot;) and attempted to connect it to our WiFi in the office.</p>
<p>Every time it returned “Windows was unable to connect to CrocusWiFi”</p>
<p>Our network is nothing out of the ordinary – We use a plain old <a href="http://www.belkin.com/uk/support/article/?lid=enu&amp;pid=f5d7632uk4a&amp;aid=5591&amp;scid=0" target="_blank">Belkin F5D7632</a> router, with WPA2-Personal security, TKIP. Nothing fancy, and plenty of other devices use this without a problem.</p>
<p>A phone call to Dell technical department predictably concluded that it must be our WiFi networks’ fault (not their laptop, of course) despite several devices (including other Dell machines) being successfully connected, without a hitch.</p>
<p>They agreed to replace the unit.</p>
<p>When the replacement unit turned up, the exact same error occurred.   <br />I haven’t had time to dig around trying to find out what the problem is, however I suspect it’s a software issue.</p>
<p>If anyone can shed any light on this, please feel free to comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/gadgets-and-hardware/dell-latitude-e5500-windows-was-unable-to-connect-to-network-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Google Chrome Extension</title>
		<link>http://www.alexjamesbrown.com/development/create-a-google-chrome-extension/</link>
		<comments>http://www.alexjamesbrown.com/development/create-a-google-chrome-extension/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 13:39:00 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chrome extensions]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://www.alexjamesbrown.com/?p=775</guid>
		<description><![CDATA[I’ve been meaning to look into creating a Google Chrome extension for a while. Earlier this week, I successfully RickRoll’d Rob Ashton on twitter, which in turn, after a RT, ...]]></description>
			<content:encoded><![CDATA[<p>I’ve been meaning to look into creating a Google Chrome extension for a while.</p>
<p>Earlier this week, I successfully RickRoll’d Rob Ashton on twitter, which in turn, after a RT, RickRoll’d several others. Many of whom replied with tweets like </p>
<blockquote><p><a href="http://twitter.com/CodingInsomnia/statuses/50935107451756544" target="_blank">@alexjamesbrown @RobAshton You bastards! <img src='http://www.alexjamesbrown.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </a></p>
<p><a href="http://twitter.com/demisbellot/statuses/50935150531461120" target="_blank">@alexjamesbrown @RobAshton Damn it! grrr.</a></p>
</blockquote>
<p>So, that got me thinking.</p>
<p>What if there was a way to <em>stop </em>you being RickRoll’d. Then I remembered I wanted to learn how to create a Google Chrome Extension… The two ideas fused, and RickMeNot was born.</p>
<h3>Step 1 – Create a Manifest File</h3>
<p>I created a RickMeNot directory (and init a git repo, of course…)</p>
<p>Then, create a new file using &lt;insert your favourite text editor here&gt;</p>
<p>All&#160; extensions, installable web apps and themes have a manifest file.    <br />This is a JSON file, needs to be called, quite descriptively, manifest.json.</p>
<p><a href="http://code.google.com/chrome/extensions/manifest.html" target="_blank"><em>Read more on Manifest Files</em></a></p>
<p>The manifest.json for RickMeNot looks like this</p>
<pre class="brush: xhtml; toolbar: false">{
  &quot;name&quot;: &quot;RickMeNot&quot;,
  &quot;version&quot;: &quot;0.1&quot;,
  &quot;description&quot;: &quot;Prevents you from being rickroll'd.&quot;,
  &quot;background_page&quot;: &quot;background.html&quot;,

  &quot;permissions&quot; : [
    &quot;tabs&quot;
  ],

  &quot;icons&quot; : {
    &quot;48&quot; : &quot;icon-48.png&quot;,
    &quot;128&quot; : &quot;icon-128.png&quot;
  }
}</pre>
<p>Most of this is fairly self explanatory.</p>
<p>What we’re basically doing, is setting the name, version and description of the extension.<br />
  <br />We then specify the background_page. </p>
<p>A background page, is basically a long running script that manages a task in the background, while the extension is active.</p>
<p>This particular extension won’t need a fancy button (<a href="http://code.google.com/chrome/extensions/browserAction.html" target="_blank">Browser Action</a>) or anything like that, so we only need to specify our background page.</p>
<p><strong>Permissions<br />
    <br /></strong>One thing to take not of is the permissions array. </p>
<p>This particular extension needs to be able to access the urls of tabs etc… so, we’ll need permission to use “tabs”.</p>
<h3>Background Page</h3>
<p>Ok. So we have our manifest file that <em>tells </em>the extension what to do, so now we need to create a file that tells it how. This will be where the main functionality of this extension is.</p>
<p>Although this is a .html it doesn’t have to contain the usual doctype and other tags.<br />
  <br />It simply needs a &lt;script&gt; and &lt;/script&gt; tag, with all the script for the code in between.</p>
<p>Let’s start real simple:</p>
<pre class="brush: javascript; toolbar: false">

&lt;script&gt;
    chrome.tabs.onUpdated.addListener(tab_updated);
&lt;/script&gt;
</pre>
<p>What this does, is add an event handler for the tabs.onUpdated event.<br />
  <br />As expected, this fires when a tab (any tab) is updated.</p>
<p>Note: I’ve called our callback <strong>tab_updated – </strong>this can of course be called anything.</p>
<p>Our tab_updated function looks like this:</p>
<pre class="brush: javascript; toolbar: false">function tab_updated(tabId, changeInfo, tab) {
    for (a in rickUrls) {
        if (tab.url == rickUrls[a]) {
            chrome.tabs.update(tab.id, { url: 'savedFromARickRoll.html' });
        }
    }
};</pre>
<p>Ok- so what this does, is loop through all the values in our (as yet undefined) rickUrls and checks if the tab.url (the value from the passed in tab object) is equal to one of the values in our array.</p>
<p>If it does, it updates the tabs url (think of this as a redirect) to “savedFromARickRoll.html” (more on this later)</p>
<h3>Populating our array using body onload</h3>
<p>So, now we need to populate our rickUrls array.</p>
<p>While our background page doesn’t <em>have </em>to have HTML tags, it can. It can also contain some client side executed javascript.</p>
<p>In this instance, we’re most interested in executing the <a href="http://www.w3schools.com/jsref/event_body_onload.asp" target="_blank">body onload event</a></p>
<p>In our background.html we simply add:</p>
<pre class="brush: xhtml; toolbar: false">&lt;body onload=&quot;init()&quot;&gt;
&lt;/body&gt;</pre>
<p>Our “init” function is in between the &lt;script&gt; &lt;/script&gt; tags and looks like:</p>
<pre class="brush: javascript; toolbar: false">function init() {

    rickUrls = new Array(
      &quot;http://www.youtube.com/watch?v=oHg5SJYRHA0&quot;,
      &quot;http://www.youtube.com/watch?v=EK2tWVj6lXw&quot;,
      &quot;http://www.youtube.com/watch?v=XZ5TajZYW6Y&quot;
      )
}</pre>
<p>In version 0.1, we’re just hardcoding a few of the known youTube URL’s</p>
<p>In later versions, I’ll rewrite this to check an external file / service or something to get an up-to-date list of them.</p>
<h3>Putting It All Together</h3>
<p>This is what our background.html looks like:</p>
<pre class="brush: javascript; toolbar: false">&lt;script&gt;

    // Simple array containing the URLs of Rick Astley - Never Gonna Give You Up videos.
    // In this version, we're hard coding it, however later on, we'll make this dynamic
    var rickUrls = new Array();

    // Function that is called on the body onload event
    function init() {

        //fill our array with the URLs
        rickUrls = new Array(
		&quot;http://www.youtube.com/watch?v=oHg5SJYRHA0&quot;,
		&quot;http://www.youtube.com/watch?v=EK2tWVj6lXw&quot;,
		&quot;http://www.youtube.com/watch?v=XZ5TajZYW6Y&quot;
		)
    }

    // This function is called by the listener we added, when the url of a tab changes.
    function tab_updated(tabId, changeInfo, tab) {
        for (a in rickUrls) {
            if (tab.url == rickUrls[a]) {
                chrome.tabs.update(tab.id, { url: 'savedFromARickRoll.html' });
            }
        }
    };

    // Listen for any changes to the URL of any tab.
    chrome.tabs.onUpdated.addListener(tab_updated);

&lt;/script&gt;

&lt;body onload=&quot;init()&quot;&gt;
&lt;/body&gt;</pre>
<h3>Files within an Extension</h3>
<p>An extension can contain files, like our <a href="https://github.com/alexjamesbrown/RickMeNot/blob/master/savedFromARickRoll.html" target="_blank">savedFromARickRoll.html</a>, and you can reference them locally.</p>
<p>This also applies to images (see the image in our <a href="https://github.com/alexjamesbrown/RickMeNot/blob/master/savedFromARickRoll.html" target="_blank">savedFromARickRoll.html</a> – <a href="https://github.com/alexjamesbrown/RickMeNot/blob/master/noRickRoll.jpg" target="_blank">noRickRoll.jpg</a>)</p>
<p>You can’t however, refer to anything else on disk (c:\ or anything like that)<br />
  <br />This is obviously for security reasons.</p>
<h3>Source</h3>
<p>I’ve put all the source for this post on GitHub<br />
  <br />You can download it here: <a href="https://github.com/alexjamesbrown/RickMeNot">https://github.com/alexjamesbrown/RickMeNot</a></p>
<h3>What’s next…</h3>
<p>I’ve got a couple of follow up posts planned on this.</p>
<p>Firslty, a short one on how to list your extension in the Google Apps Marketplace (will add link as soon as it’s ready)</p>
<p>Also, when I get time, I’ll write a post along the lines of calling external services to get a list of updated Rick URLs</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjamesbrown.com/development/create-a-google-chrome-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

