<?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>Seán Hayes &#187; Seán Hayes</title>
	<atom:link href="http://seanhayes.name/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanhayes.name</link>
	<description>Web Developer in Rochester, NY (Django, JavaScript, LAMP)</description>
	<lastBuildDate>Tue, 06 Mar 2012 01:07:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Awesome Web App, Codecademy, Teaches You to Program</title>
		<link>http://seanhayes.name/2011/09/28/awesome-web-app-codecademy-teaches-program/</link>
		<comments>http://seanhayes.name/2011/09/28/awesome-web-app-codecademy-teaches-program/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 04:17:07 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=276</guid>
		<description><![CDATA[I just found out about this cool web app called Codecademy that teaches programming to complete novices. As soon as you visit the site you can start learning to program without having to create an account, and as of now &#8230; <a href="http://seanhayes.name/2011/09/28/awesome-web-app-codecademy-teaches-program/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just found out about this cool web app called <a href="http://www.codecademy.com/">Codecademy</a> that teaches programming to complete novices. As soon as you visit the site you can start learning to program without having to create an account, and as of now it looks like it&#8217;s completely free. If you or anyone you know is interested in learning to program I recommend trying it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/09/28/awesome-web-app-codecademy-teaches-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Web Intents Javascript Events Not Firing</title>
		<link>http://seanhayes.name/2011/08/31/twitter-web-intents-javascript/</link>
		<comments>http://seanhayes.name/2011/08/31/twitter-web-intents-javascript/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 20:33:35 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[web intents]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=265</guid>
		<description><![CDATA[If you&#8217;re trying out Twitter&#8217;s Web Intents Javascript Events and it&#8217;s not working, be aware that they only work if your HTML page is loaded from an HTTP server. If you open your page locally off your hard drive it &#8230; <a href="http://seanhayes.name/2011/08/31/twitter-web-intents-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying out Twitter&#8217;s <a href="https://dev.twitter.com/docs/intents/events">Web Intents Javascript Events</a> and it&#8217;s not working, be aware that they only work if your HTML page is loaded from an HTTP server. If you open your page locally off your hard drive it won&#8217;t work, though you can fire up an Apache instance on your localhost and it&#8217;ll work from there.</p>
<p>Source: <a href="https://dev.twitter.com/comment/reply/304/491">https://dev.twitter.com/comment/reply/304/491</a></p>
<p>Update: It looks like this can also happen with the Facebook JavaScript API: <a href="http://forum.developers.facebook.net/viewtopic.php?pid=362167#p362167">http://forum.developers.facebook.net/viewtopic.php?pid=362167#p362167</a>. I guess <a href="http://vimeo.com/forums/topic:28340">it&#8217;s because they use iFrames</a>, and using them locally can cause security problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/08/31/twitter-web-intents-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saved Web Pages from Firefox Have Scripts Removed</title>
		<link>http://seanhayes.name/2011/08/26/saved-web-pages-firefox-scripts/</link>
		<comments>http://seanhayes.name/2011/08/26/saved-web-pages-firefox-scripts/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 21:39:53 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[maf]]></category>
		<category><![CDATA[missing]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=262</guid>
		<description><![CDATA[So, I was just in the middle of a programming test for a job application where I had to download an HTML page, edit the JavaScript to perform a desired task, and email it back. I downloaded the page, but &#8230; <a href="http://seanhayes.name/2011/08/26/saved-web-pages-firefox-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, I was just in the middle of a programming test for a job application where I had to download an HTML page, edit the JavaScript to perform a desired task, and email it back. I downloaded the page, but the JavaScript had been replaced by the text, &#8220;Script removed by snapshot save&#8221;. Luckily the removed JS was only one line and I was able to figure out what it was.</p>
<p>Afterwards, I went searching for the cause and found <a href="http://forums.informaction.com/viewtopic.php?f=10&#038;t=5641#p25574" title="InformAction Forums &bull; View topic - Script removed by snapshot save">this forum post</a>, which explains that the problem is caused by the Mozilla Archive Format extension, which has a setting that even affects pages not saved as .maff. To fix the problem, go into the MAF extension settings and change &#8220;When saving complete web page contents:&#8221; from &#8220;Take a faithful snapshot of the page&#8221; to one of the other options.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/08/26/saved-web-pages-firefox-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recruiter SPAM</title>
		<link>http://seanhayes.name/2011/08/10/recruiter-spam/</link>
		<comments>http://seanhayes.name/2011/08/10/recruiter-spam/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 19:48:20 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[recruiter]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=254</guid>
		<description><![CDATA[Got a job posting mass emailed to me today, here&#8217;s an excerpt: &#8220;Our records show based on your resume, which was imported into our system recently that you are an experienced IT professional whose background may possibly align to the &#8230; <a href="http://seanhayes.name/2011/08/10/recruiter-spam/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Got a job posting mass emailed to me today, here&#8217;s an excerpt:</p>
<p>&#8220;Our records show based on your resume, which was <em>imported into our system</em> recently that you are an experienced IT professional whose background <em>may possibly align</em> to the <em>senior level position</em> we have been retained to work on&#8230;&#8221; [Emphasis added by me.]</p>
<p>Wow, they didn&#8217;t even try to pretend that they read my resume or sent me a personal email, pretty ballsy, and of course the job had nothing to do with my skill set. It&#8217;s also hard to imagine any quality senior level candidates responding to such a faceless, generic email. To any recruiters who might be reading, this sort of email gets marked as SPAM.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/08/10/recruiter-spam/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cookies Not Saved In Internet Explorer for Facebook iframe Apps</title>
		<link>http://seanhayes.name/2011/07/08/cookies-saved-internet-explorer/</link>
		<comments>http://seanhayes.name/2011/07/08/cookies-saved-internet-explorer/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 01:02:16 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[p3p]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=238</guid>
		<description><![CDATA[I&#8217;m making a Facebook game using Django and was having a problem with Internet Explorer. The Problem: After login the page would render correctly as if the user was logged in, but when navigating to another page it was as &#8230; <a href="http://seanhayes.name/2011/07/08/cookies-saved-internet-explorer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m making a Facebook game using Django and was having a problem with Internet Explorer.</p>
<p>The Problem: After login the page would render correctly as if the user was logged in, but when navigating to another page it was as if the user wasn&#8217;t logged in. Upon investigation I could see that the cookies weren&#8217;t being saved.</p>
<p>The Solution: A quick Gogole search brought me to this blog post: <a href="http://adamyoung.net/IE-Blocking-iFrame-Cookies">IE Blocking iFrame Cookies</a>. It&#8217;s an easy to fix P3P issue, and the author describes how to add the necessary header for various languages/frameworks.</p>
<p>Rather than add the header to each Django view or write custom Django middleware, I just added the header to my Apache configuration. The following goes in your VirtualHost Directive:</p>
<p>Header add P3P &#8216;CP=&#8221;IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT&#8221;&#8216;</p>
<p>In order to work you have to enable mod_headers (run &#8220;sudo a2enmod headers&#8221;).</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/07/08/cookies-saved-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Meta Languages and Compilers</title>
		<link>http://seanhayes.name/2011/03/14/css-meta-languages-compilers/</link>
		<comments>http://seanhayes.name/2011/03/14/css-meta-languages-compilers/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 20:22:38 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[language]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=228</guid>
		<description><![CDATA[So, I&#8217;ve finally decided to add a CSS framework into my workflow, namely Blueprint. I&#8217;m not very skilled when it comes to graphic design (though I&#8217;m trying to learn) and the CSS frameworks out there give you some nice looking &#8230; <a href="http://seanhayes.name/2011/03/14/css-meta-languages-compilers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve finally decided to add a CSS framework into my workflow, namely <a href="http://www.blueprintcss.org/">Blueprint</a>. I&#8217;m not very skilled when it comes to graphic design (though I&#8217;m trying to learn) and the CSS frameworks out there give you some nice looking web pages. The only problem is they require you to add extra classes to each HTML element you want to use them with. The whole point of CSS is you can modify it without changing your markup. If I could set an id for  each element (#content, #footer) and have each id style definition simply inherit the CSS framework classes I want to use my problem would  be solved, but that can only be done using a CSS meta language and compiler.</p>
<p>I was looking at <a href="https://github.com/dziegler/django-css">django-css</a>, a project which would integrate CSS compilation into my Django projects, and it mentioned 4 popular languages:  <a href="http://ncannasse.fr/projects/hss" target="_blank">HSS</a>, <a href="http://sass-lang.com/" target="_blank">Sass</a>, <a href="http://sandbox.pocoo.org/clevercss/" target="_blank">CleverCSS</a>, and <a href="http://lesscss.org/" target="_blank">LESS</a>.</p>
<p>Here&#8217;s a spreadsheet comparing the features:</p>
<p><iframe width='500' height='300' frameborder='0' src='https://spreadsheets.google.com/pub?hl=en&#038;hl=en&#038;key=0AhZ3SH4irFLEdDlpekFWQ2dKdmFETjFVY2FObERYN0E&#038;output=html&#038;widget=true'></iframe></p>
<p><strong>Popularity</strong><br />
I think SASS is by far the most popular. I&#8217;m secretly rooting for it, since it&#8217;s probably in higher demand and would  therefore be a more valuable skill to have, though it would be awkward  introducing Ruby dependencies in a Python project.</p>
<p><strong>Inheritance</strong><br />
The main reason I want to use a CSS meta language is for the inheritance. When looking at the documentation for CleverCSS I couldn&#8217;t see any inheritance implementation, which is a shame because it&#8217;s the only one implemented in Python and would&#8217;ve been easier to integrate into my Django project.</p>
<p>HASS example:</p>
<pre><code>var nomargin = { margin : 0px; padding : 0px; }

pre {
    $nomargin;
    color : #FF0000;

}</code></pre>
<p>The inherited styles can&#8217;t be a normal CSS class, so this can&#8217;t be used to inherit classes from a CSS framework.</p>
<p>SASS Mixin example:</p>
<pre><code>@mixin table-base {
  th {
    text-align: center;

    font-weight: bold;
  }
  td, th {padding: 2px}
}

@mixin left($dist) {
  float: left;
  margin-left: $dist;
}

#data {
  @include left(10px);
  @include table-base;
}
</code></pre>
<p>The inherited definition needs to be declared as a mixin, and I&#8217;d rather not modify any CSS frameworks. There is a project called <a href="http://compass-style.org/" target="_blank">Compass</a> that provides CSS frameworks rewritten in SASS, but I&#8217;d rather not add yet another dependency into my project, especially a Ruby one (nothing against Ruby, it&#8217;s just undesirable within the context of a Python  project).</p>
<p>SASS Inheritance example:</p>
<pre><code>.error {
  border: 1px #f00;
  background: #fdd;
}
.error.intrusion {
  font-size: 1.3em;
  font-weight: bold;
}

.badError {
  @extend .error;

  border-width: 3px;
}
</code></pre>
<p>Just what I want, but it generates more code than needed:</p>
<pre><code>/* CSS */

.error, .badError {
  border: 1px #f00;
  background: #fdd;
}

.error.intrusion,

.badError.intrusion {
  font-size: 1.3em;
  font-weight: bold;
}

.badError {
  border-width: 3px;
}
</code></pre>
<p>LESS example:</p>
<pre><code>.bordered {
  border-top: dotted 1px black;

  border-bottom: solid 2px black;
}

#menu a {
  color: #111;

  .bordered;
}
.post a {
  color: red;
  .bordered;
}
</code>
</pre>
<p>Generates:</p>
<pre><code>#menu a {
  color: #111;
  border-top: dotted 1px black;

  border-bottom: solid 2px black;
}
.post a {
  color: red;
  border-top: dotted 1px black;

  border-bottom: solid 2px black;
}
</code></pre>
<p>Exactly what I need. The documentation says, &#8220;Any CSS <em>class</em>, <em>id</em> or <em>element</em> ruleset can be mixed-in that way.&#8221; And since it&#8217;s written in JavaScript, you can load your LESS files and compile them on the client side, which should make designing and debugging a lot easier. LESS best suits my needs, so it&#8217;s the one I&#8217;ll be going with.</p>
<p>Update: It turns out LESS doesn&#8217;t eliminate the inherited classes, they&#8217;re still present in the output. Even so, I still think it best suits my needs.</p>
<p>Update 2: It looks like django-css isn&#8217;t being maintained, so you should probably use <a href="https://github.com/jezdez/django_compressor">django_compressor</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/03/14/css-meta-languages-compilers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaunchRock Viral Sign Up Pages</title>
		<link>http://seanhayes.name/2011/02/17/launchrock-viral-sign-pages/</link>
		<comments>http://seanhayes.name/2011/02/17/launchrock-viral-sign-pages/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 18:25:13 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Internet Marketing/SEO/Personal Branding]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=224</guid>
		<description><![CDATA[I came across this new web app for creating viral sign up pages called LaunchRock. I&#8217;d love to try it out, but in order to get an invite to the beta I need 3 people to sign up. If you&#8217;re &#8230; <a href="http://seanhayes.name/2011/02/17/launchrock-viral-sign-pages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I came across this new web app for creating viral sign up pages called <a href="http://launchrock.com/ap914">LaunchRock</a>. I&#8217;d love to try it out, but in order to get an invite to the beta I need 3 people to sign up. If you&#8217;re interested please sign up using <a title="LaunchRock" href="http://launchrock.com/ap914">my referral link</a>. It&#8217;s free!</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2011/02/17/launchrock-viral-sign-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to Convert PSD Files to HTML Templates</title>
		<link>http://seanhayes.name/2010/12/01/script-convert-psd-files-html/</link>
		<comments>http://seanhayes.name/2010/12/01/script-convert-psd-files-html/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 23:37:59 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[psd2html]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[linux rant]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=208</guid>
		<description><![CDATA[For a while now I&#8217;ve been tinkering with this GIMP Plugin that converts PSD files to HTML templates. There&#8217;s been some recent interest in it, so I&#8217;ve decided to work on it some more and get a usable release out. &#8230; <a href="http://seanhayes.name/2010/12/01/script-convert-psd-files-html/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For a while now I&#8217;ve been tinkering with this <a title="psd2html-gimp-plug-in Repository on GitHub" href="https://github.com/SeanHayes/psd2html-gimp-plug-in" target="_blank">GIMP Plugin that converts PSD files to HTML templates</a>. There&#8217;s been some recent interest in it, so I&#8217;ve decided to work on it some more and get a usable release out.</p>
<p><a href="https://github.com/SeanHayes/psd2html-gimp-plug-in/archives/master" target="_blank">Download psd2html-gimp-plug-in</a></p>
<p><strong>How do I install/use it?</strong><br />
The <a title="psd2html-gimp-plug-in Repository on GitHub" href="https://github.com/SeanHayes/psd2html-gimp-plug-in" target="_blank">project page</a> will have current installation and usage instructions.</p>
<p><strong>What does it do?</strong><br />
The script detects which layers are on top of other layers and what their size and relative positions to each other are. This data is used to arrange the layers into a hierarchy, which can then be expressed as HTML nodes. Each layer is expressed as a &lt;div&gt; element with a unique id based on the layer name, and that id is used to specify the size and position of that element using CSS. Text layers are saved as text within the HTML file, and image layers are extracted to the &lt;template_name&gt;_files/ directory, relative to your PSD file.</p>
<p><strong>Can you port this to Adobe Photoshop?</strong><br />
I think it would be possible to write a similar plugin for Photoshop, but for a large variety of reasons it&#8217;s not very practical. Reasons include: GIMP is <abbr title="Free and Open Source Software">FOSS</abbr> and Photoshop is proprietary; GIMP plugins can be written in Python and I think Photoshop plugins have to be in written in C, C++, or Flash/Flex; based on what I&#8217;ve read on Adobe&#8217;s website I&#8217;d need to get their permission; and I don&#8217;t have Photoshop. Plus, Photoshop and the development tools I&#8217;d need only run on Mac and Windows, and I switched to Ubuntu almost 2 years ago.<br />
I know lots of people prefer Photoshop and hate GIMP. If so you can always do your work in Photoshop and just use GIMP for PSD conversion.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2010/12/01/script-convert-psd-files-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advice from my Experience with OAuth</title>
		<link>http://seanhayes.name/2010/07/02/advice-experience-oauth/</link>
		<comments>http://seanhayes.name/2010/07/02/advice-experience-oauth/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 01:57:44 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[Darkroom]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[picasa]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=191</guid>
		<description><![CDATA[I recently finished coding the OAuth authentication method for accessing Picasa photos from within Darkroom. Since it was written client side using JavaScript I was trying to be as minimalist as possible, so I wrote my own minimal implementation rather &#8230; <a href="http://seanhayes.name/2010/07/02/advice-experience-oauth/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently finished coding the <a href="http://oauth.net/">OAuth</a> authentication method for accessing <a href="http://picasaweb.google.com/">Picasa</a> photos from within <a href="http://mugtug.com/darkroom/">Darkroom</a>. Since it was written client side using JavaScript I was trying to be as minimalist as possible, so I wrote my own minimal implementation rather than using a library. I&#8217;m sure most developers using OAuth use a library, which is probably why it&#8217;s hard to find advice on writing your own implementation, so I thought I&#8217;d share some tips, FAQ style.</p>
<p><strong>Use the right documentation.</strong><br />
There&#8217;s a lot of outdated docs out there. I frequently find myself at <a href="http://oauth.net/core/1.0a/">OAuth Core 1.0 Revision A</a>, and it&#8217;s such a pretty page and easy on the eyes, but way at the top where you&#8217;re likely to miss it is a notice saying it&#8217;s obsolete. The notice says to use <a href="http://tools.ietf.org/html/rfc5849">RFC 5849: The OAuth 1.0 Protocol</a> and, although hideous, it&#8217;s up to date and more complete.</p>
<p><strong>How&#8217;s the signature algorithm written?</strong><br />
Here&#8217;s some pseudo-code:<br />
<script type="text/javascript" src="http://gist.github.com/462169.js?file=signRequest.pseudo_code"></script></p>
<p>If you&#8217;re writing in JavaScript as well I recommend <a href="http://code.google.com/p/crypto-js/">Crypto-JS</a>.</p>
<p><strong>What&#8217;s the format for the timestamp?</strong><br />
It&#8217;s just a UNIX timestamp (in seconds).</p>
<p><strong>How do I generate a nonce value?</strong><br />
The OAuth spec just says it&#8217;s a random string. I think the Google documentation says something about using a string representation of a 64 bit integer. I had no idea what they were talking about, but somewhere I read you just need to md5 hash a random integer, and it worked for me.</p>
<p><strong>If developing for a Google service, use their OAuth playground.</strong><br />
Their <a href="http://googlecodesamples.com/oauth_playground/">OAuth Playground</a> is a great way to see the process you have to go through and what the requests look like. If trying to authenticate with another provider see if they also have an API test app.</p>
<p><strong>Don&#8217;t expect detailed errors.</strong><br />
You&#8217;ll be lucky if the response tells you &#8220;signature invalid&#8221;, but you won&#8217;t be told what&#8217;s wrong with it. My strategy was to compare my signatures and parameters to those used by the Google Playground; taking values from there that you know are valid and using them to test your code is a good way to debug.</p>
<p><strong>The scope parameter has to EXACTLY match the URLs used in your API calls</strong><br />
In the Google OAuth Playground, selecting &#8220;Picasa Web&#8221; will input &#8220;https://picasaweb.google.com/data/&#8221; for the scope. Note the use of https:// for the protocol. If you make API calls using that URL, it will fail since none of the Picasa services are served over https. If you try to make calls using regular http you will get an OAuth error saying invalid scope. In order for it all to work, you have to use &#8220;http://picasaweb.google.com/data/&#8221; for the scope.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2010/07/02/advice-experience-oauth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up SSL on Apache</title>
		<link>http://seanhayes.name/2010/07/02/setting-ssl-apache/</link>
		<comments>http://seanhayes.name/2010/07/02/setting-ssl-apache/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 18:21:25 +0000</pubDate>
		<dc:creator>Seán Hayes</dc:creator>
				<category><![CDATA[Web Design & Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://seanhayes.name/?p=187</guid>
		<description><![CDATA[While locally testing Darkroom over HTTPS, Firefox gave me the following error: &#8220;Error code: ssl_error_rx_record_too_long&#8221;. Turns out I&#8217;d never configured the Apache instance on my laptop to use SSL. Once you&#8217;ve got the right information it&#8217;s really quick to fix. &#8230; <a href="http://seanhayes.name/2010/07/02/setting-ssl-apache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While locally testing Darkroom over HTTPS, Firefox gave me the following error: &#8220;Error code: ssl_error_rx_record_too_long&#8221;. Turns out I&#8217;d never configured the Apache instance on my laptop to use SSL.</p>
<p>Once you&#8217;ve got the right information it&#8217;s really quick to fix. Here&#8217;s 2 links that I found helpful:</p>
<p><a style="font-weight: bold;" href="http://slacksite.com/apache/certificate.php">Generating an SSL Certificate with Apache+mod_ssl</a><br />
Has the commands you need for generating a self signed certificate.</p>
<p>If while generating the certificate you get the error &#8220;unable to write &#8216;random state&#8217;&#8221;, you&#8217;ll need to chown the .rnd file (sudo chown user:group ~/.rnd) and try again.<br />
I put all the generated files in /etc/apache2/ssl/.</p>
<p><a style="font-weight: bold;" href="http://lookit.typepad.com/lookit/2010/04/how-to-get-apache-to-do-both-http-and-https-on-one-ip-address.html">How to get Apache to do both HTTP and HTTPS on one IP address?</a><br />
Shows the basic Apache configuration needed for HTTPS. To get HTTPS working, I just copied my existing virtual host definition, modified it to use the port 443, and added the SSLEngine, SSLCertificateFile, and SSLCertificateKeyFile directives.</p>
<p>Here&#8217;s a copy of my file:<br />
<script src="http://gist.github.com/461702.js?file=website"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://seanhayes.name/2010/07/02/setting-ssl-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

