<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Chris Shiflett</title>
        <link>http://shiflett.org/</link>
        <language>en-us</language>
        <description>Web Craftsmanship &amp; Commentary</description>


        <feedburner:info uri="shiflett" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>40.677249</geo:lat><geo:long>-73.969747</geo:long><image><link>http://shiflett.org/</link><url>http://shiflett.org/img/profile_pic.jpg</url><title>Chris Shiflett</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://shiflett.org/rss" /><feedburner:emailServiceId>shiflett</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
            <title>JavaScript Study Guide</title>
            <link>http://shiflett.org/blog/2012/apr/javascript-study-guide</link>
            <guid>http://shiflett.org/blog/2012/apr/javascript-study-guide</guid>
            <description><![CDATA[A few months ago, I wrote about learning JavaScript. I'm already pretty comfortable with the language, and although I did break the chain, I'm happy to report that I'm still at it. Never stop learning, right?

In case it's helpful to others, I thought &#8230;]]></description>
            <content:encoded><![CDATA[<p>A few months ago, I wrote about <a href="http://shiflett.org/blog/2012/feb/learning-javascript">learning JavaScript</a>. I'm already pretty comfortable with the language, and although I did break the chain, I'm happy to report that I'm still at it. Never stop learning, right?</p>

<p>In case it's helpful to others, I thought I'd mention a few more resources. I may even keep this list updated. If I don't, you can always browse my <a href="https://pinboard.in/u:shiflett/t:javascript/">full list of JavaScript links</a>.</p>

<dl>
    <dt><a href="http://eloquentjavascript.net/contents.html">Eloquent JavaScript</a></dt>
    <dd>This is the interactive tutorial I mentioned in <a href="http://shiflett.org/blog/2012/feb/learning-javascript">my original post</a>.</dd>

    <dt><a href="http://www.amazon.com/exec/obidos/ASIN/0596517742/ref=nosim/chrisshiflett-20">JavaScript: The Good Parts</a></dt>
    <dd>This is the book I mentioned in my original post. Everyone recommends it.</dd>

    <dt><a href="http://www.amazon.com/exec/obidos/ASIN/1449320198/ref=nosim/chrisshiflett-20">JavaScript for PHP Developers</a></dt>
    <dd>Very fortuitously, I was asked to review a new book by <a href="http://phpied.com/">Stoyan Stefanov</a> shortly after I began learning JavaScript. I loved it. Stoyan wrote an article for PHP Advent called <a href="http://phpadvent.org/2010/javascript-for-php-developers-by-stoyan-stefanov">JavaScript for PHP Developers</a>. Read that, and if you like it, <a href="http://www.amazon.com/exec/obidos/ASIN/1449320198/ref=nosim/chrisshiflett-20">order the book</a>.</dd>

    <dt><a href="http://phpjs.org/">PHP Functions in JS</a></dt>
    <dd>This is a fantastic list of PHP functions implemented in JavaScript. If you want to see how you would do something in JavaScript, this is a good place to start.</dd>

    <dt><a href="http://www.amazon.com/exec/obidos/ASIN/0596806752/ref=nosim/chrisshiflett-20">JavaScript Patterns</a></dt>
    <dd>Several people have recommended that I read this book, also by Stoyan Stefanov.</dd>

    <dt><a href="http://phpied.com/3-ways-to-define-a-javascript-class/">3 Ways to Define a JavaScript Class</a></dt>
    <dd>After I learned <a href="https://twitter.com/#!/shiflett/status/175661258626957312">there are no classes in JavaScript</a>, I found this great post by Stoyan explaining the issue in great detail.</dd>

    <dt><a href="https://developer.mozilla.org/en-US/learn/javascript">Learn JavaScript</a></dt>
    <dd>This is a great list of JavaScript resources maintained by Mozilla.</dd>

    <dt><a href="http://bonsaiden.github.com/JavaScript-Garden/">JavaScript Garden</a></dt>
    <dd>A really good collection of documentation about the most quirky parts of the JavaScript programming language. Recommended by <a href="http://shiflett.org/community/@thehuzz">Robert Huzzey</a>.</dd>

    <dt><a href="http://jslint.com/">JSLint</a></dt>
    <dd>As an unapologetic pedant, I love anything that enforces rigor, especially when I'm in unfmiliar territory. Just as you might rely on the <a href="http://validator.w3.org/">W3C Validator</a> to make sure your HTML is valid, JSLint is a great tool for checking your JavaScript.</dd>

    <dt><a href="http://ejohn.org/apps/learn/">Learning Advanced JavaScript</a></dt>
    <dd>An interactive tutorial from John Resig that's a good step up from the basics.</dd>

    <dt><a href="http://yuiblog.com/crockford/">Crockford on JavaScript</a></dt>
    <dd>I have not watched these yet, but everyone says Douglas Crockford is a great teacher. This is a nice compilation of videos, transcripts, and photos from his acclaimed series of lectures on the history of JavaScript, its features, and its use.</dd>

    <dt><a href="http://blog.mozilla.com/devtools/2011/08/15/introducing-scratchpad/">Introducing Scratchpad</a></dt>
    <dd>An introduction to Firefox's web developer tool called Scratchpad. The browser is the best place to experiment with JavaScript, especially once you get past learning the basic syntax.</dd>

    <dt><a href="http://addyosmani.com/resources/essentialjsdesignpatterns/book/">Essential JavaScript Design Patterns For Beginners</a></dt>
    <dd>This looks like a good list of common JavaScript design patterns, complete with explanations and examples. Probably best used as a reference. I started to read it from start to finish, but that gets boring pretty quickly.</dd>

    <dt><a href="http://jquery-tutorial.net/">The Complete jQuery Tutorial</a></dt>
    <dd>This has been recommended to me as a great place to start learning jQuery, the popular JavaScript library.</dd>

</dl>

<p>That's my list. What did I miss?</p>]]></content:encoded>
            <pubDate>Thu, 26 Apr 2012 14:28:36 GMT</pubDate>
        </item>


        <item>
            <title>Brooklyn Beta 2012</title>
            <link>http://shiflett.org/blog/2012/mar/brooklyn-beta-2012</link>
            <guid>http://shiflett.org/blog/2012/mar/brooklyn-beta-2012</guid>
            <description><![CDATA[Brooklyn Beta is becoming more than a conference.

It's still a conference, too, and although I never did recap last year's conference like I wanted to, I did collect a bunch of posts, photos, and videos on Gimme Bar. Also, Nate Bolt and Captain &amp; &#8230;]]></description>
            <content:encoded><![CDATA[<p><a href="http://brooklynbeta.org/">Brooklyn Beta</a> is becoming more than a conference.</p>

<p>It's still a conference, too, and although I never did recap <a href="http://brooklynbeta.org/2011">last year's conference</a> like I wanted to, I did collect a bunch of <a href="https://gimmebar.com/loves/chris/collection/brooklyn-beta">posts, photos, and videos</a> on Gimme Bar. Also, <a href="http://boltron.com/">Nate Bolt</a> and <a href="http://captainandthefox.com/">Captain &amp; the Fox</a> collaborated on a <a href="https://vimeo.com/36225246">really cool video</a> that captures the spirit of it. I love it. Check it out:</p>

<p><iframe src="http://player.vimeo.com/video/36225246" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>

<p>If you were there last year, you might like to know that Joel Rose launched <a href="http://newclassrooms.org/">New Classrooms</a>, Tony Fadell launched <a href="http://nest.com/">Nest</a>, and Todd Park was <a href="http://www.whitehouse.gov/blog/2012/03/09/todd-park-named-new-us-chief-technology-officer">named the new CTO of the United States</a>. Pretty cool stuff.</p>

<p>We've settled on the dates for <a href="http://brooklynbeta.org/2012">this year's conference</a>. October 10th, 11th, and 12th. We're planning some other events to take place the same week, so although we're keeping the conference just as small as last year, there are going to be other reasons to be in Brooklyn that week. We've also ordered some good weather, and we're gonna keep our fingers crossed all summer, so it should be a great time to be in Brooklyn. Really hope to see you there.</p>

<p>The big announcement today is something we're calling <a href="http://brooklynbeta.org/summer-camp">Summer Camp</a>. It's our attempt to provide some early funding and guidance to designer-developer teams. For all the details, see <a href="http://www.swiss-miss.com/2012/03/brooklyn-betasummer-camp.html">Tina's blog post</a> or the <a href="http://brooklynbeta.org/summer-camp">Summer Camp site</a>. We've answered some frequently asked questions that haven't even been asked yet. Yeah.</p>

<p>This is a pretty big deal for us, and we've got a lot of people to thank. Thanks to <a href="http://mailchimp.com/">MailChimp</a>, <a href="http://typography.com/">Hoefler &amp; Frere-Jones</a>, <a href="http://engineyard.com/">Engine Yard</a>, and <a href="http://etsy.com/">Etsy</a> for being so eager to support us. (If you're interested in sponsoring, please get in touch.) Thanks to <a href="http://elirousso.com/">Eli Rousso</a>, <a href="http://fffunction.co/">FFFunction</a>, and <a href="http://nateabele.com/">Nate Abele</a> for helping us with the new site. Last but not least, thanks to our <a href="http://brooklynbeta.org/summer-camp#advisors">incredible advisors</a> for their support and vote of confidence. And, of course, thanks to everyone who's attended Brooklyn Beta and helped make it something special. We really appreciate it.</p>]]></content:encoded>
            <pubDate>Tue, 27 Mar 2012 19:29:27 GMT</pubDate>
        </item>


        <item>
            <title>Svbtle Versus Obtvse</title>
            <link>http://shiflett.org/blog/2012/mar/svbtle-versus-obtvse</link>
            <guid>http://shiflett.org/blog/2012/mar/svbtle-versus-obtvse</guid>
            <description><![CDATA[I just read a post by Daniel Howells about these two stories on Hacker News:


    Codename: Svbtle by Dustin Curtis
    Codename: Obtvse


Before I make my small point, let me give you the quick synopsis. Briefly, Dustin Curtis made his own blogg&#8230;]]></description>
            <content:encoded><![CDATA[<p>I just read <a href="http://howells.ws/posts/view/93/svbtle-vs-obtvse-and-on-copying">a post by Daniel Howells</a> about these two stories on Hacker News:</p>

<ul>
    <li><a href="http://news.ycombinator.com/item?id=3742314">Codename: Svbtle by Dustin Curtis</a></li>
    <li><a href="http://news.ycombinator.com/item?id=3744237">Codename: Obtvse</a></li>
</ul>

<p>Before I make my small point, let me give you the quick synopsis. Briefly, Dustin Curtis made his own <a href="http://svbtle.com/">blogging platform</a>, opened it up to a few friends, and <a href="http://dcurt.is/codename-svbtle">blogged about it</a>. Someone else submitted it to Hacker News, and that's where the story takes a turn.</p>

<p>The Hacker News community quickly attacked Dustin's persona (he describes himself as a superhero) and the exclusivity of his blogging platform. I don't have a strong opinion about these criticisms, but I do believe them to be knee-jerk reactions based upon the false premise that Dustin was seeking the amount of attention he received.</p>

<p>This is what I object to.</p>

<p>Dustin made something and blogged about it. There's nothing wrong with that, and as <a href="http://shiflett.org/blog/2012/mar/ideas-of-march">someone who loves blogs</a>, it's exactly what I want people like Dustin to do. The only difference is that someone submitted his post to Hacker News, and it got a lot of attention. The mistake the Hacker News community routinely makes is to assume the author of whatever they read is making a big deal about something.</p>

<p>As <a href="http://shiflett.org/blog/2011/apr/april-what">I've said before</a>, I really like the way <a href="http://trentwalton.com/2011/03/30/ideas-of-march/">Trent describes blogs</a>:</p>

<blockquote><p>There's something sacred about reading a blog post on someone else's site. It's like visiting a friend's house for a quick meal 'round the breakfast table. It's personal&#8201;&#8212;&#8201;you're in their space, and the environment is uniquely suited for idea exchange and uninterrupted conversation. In many ways, we should be treating our blogs like our breakfast tables. Be welcoming &amp; gracious when you host, and kind &amp; respectful when visiting.</p></blockquote>

<p>No matter how popular someone's blog is, or how popular a particular post is, it's still their blog. It's their breakfast table.</p>

<p>Let's all try to remember that the next time we pay them a visit.</p>]]></content:encoded>
            <pubDate>Fri, 23 Mar 2012 19:36:21 GMT</pubDate>
        </item>


        <item>
            <title>Ideas of March</title>
            <link>http://shiflett.org/blog/2012/mar/ideas-of-march</link>
            <guid>http://shiflett.org/blog/2012/mar/ideas-of-march</guid>
            <description><![CDATA[I love blogs. A year ago today, I tried to start a sort of blogging revival. To my great surprise and delight, it kinda worked. For a while, I could find really interesting stuff to read every day by just browsing through my planet or #ideasofmarch on Tw&#8230;]]></description>
            <content:encoded><![CDATA[<p>I love blogs. A year ago today, I tried to start a sort of <a href="http://shiflett.org/blog/2011/mar/ideas-of-march">blogging revival</a>. To my great surprise and delight, it kinda worked. For a while, I could find really interesting stuff to read every day by just browsing through <a href="http://shiflett.org/planet">my planet</a> or <a href="https://twitter.com/search/ideasofmarch">#ideasofmarch on Twitter</a>. It was great.</p>

<p>As time passed, commitment waned. When I noticed it was almost that time of year again, I decided this was a tradition worth keeping, so here I am. I'm using this opportunity to renew my commitment to blog more, and hopefully this year's Ideas of March can provide an opportunity to let everyone know blogs are still alive and well. And appreciated.</p>

<p>If you'd like to participate, here's how:</p>

<ul>
    <li>Write a post called Ideas of March.</li>
    <li>Write about why you like blogs.</li>
    <li>If you don't already blog regularly, pledge to blog more the rest of the month.</li>
    <li>Share your thoughts on Twitter with the <a href="https://twitter.com/search/ideasofmarch">#ideasofmarch</a> hashtag.</li>
</ul>

<p>I hope you'll join us, and if you do, please leave a comment. (Comments are great, too!)</p>

<div class="note"><p>Chris Cornutt is maintaining a <a href="http://phpdeveloper.org/news/17678">list of this year's Ideas of March posts</a>.</p></div> ]]></content:encoded>
            <pubDate>Thu, 15 Mar 2012 14:06:42 GMT</pubDate>
        </item>


        <item>
            <title>Hacking Rails (and GitHub)</title>
            <link>http://shiflett.org/blog/2012/mar/hacking-rails-and-github</link>
            <guid>http://shiflett.org/blog/2012/mar/hacking-rails-and-github</guid>
            <description><![CDATA[Hacker News exploded yesterday with news of GitHub being hacked. Wanting to know what all the fuss was about, I began with GitHub's side of the story:

A GitHub user exploited a security vulnerability in the public key update form in order to add his p&#8230;]]></description>
            <content:encoded><![CDATA[<p><a href="http://news.ycombinator.com/">Hacker News</a> exploded yesterday with news of <a href="http://github.com/">GitHub</a> being hacked. Wanting to know what all the fuss was about, I began with <a href="https://github.com/blog/1068-public-key-security-vulnerability-and-mitigation">GitHub's side of the story</a>:</p>

<blockquote><p>A GitHub user exploited a security vulnerability in the public key update form in order to add his public key to the rails organization. He was then able to push a new file to the project as a demonstration of this vulnerability.</p>
<p>As soon as we detected the attack we expunged the unauthorized key and suspended the user.</p></blockquote>

<p>My confidence in the clarity of GitHub's side of the story dissipated when I read <a href="https://github.com/blog/1068-public-key-security-vulnerability-and-mitigation#comment-17266">one of the comments</a>:</p>

<blockquote><p>You didn't really "detect" anything. You were informed. It also wasn't an attack.</p>
<p>Not only did the "attacker" not do any actual damage, but he was continually ignored.</p></blockquote>

<div class="note"><p>The author of this comment, Chris Acky, also made a more comprehensive <a href="http://chrisacky.posterous.com/github-you-have-let-us-all-down">blog post about the incident</a>.</p></div>

<p>The "attacker" in question is <a href="https://github.com/homakov">Egor Homakov</a> (his account has been reinstated), and he did in fact disclose <a href="https://github.com/rails/rails/issues/5228">the vulnerability</a> a few days before he <a href="https://github.com/rails/rails/commit/b83965785db1eec019edf1fc272b1aa393e6dc57">demonstrated it</a>. There are a few facts worth noting up front:</p>

<ul>
    <li>This was not a public key security vulnerability as the title of GitHub's post suggests.</li>
    <li>Egor is not a native English speaker, which might have made the potential impact of his discovery difficult to appreciate.</li>
    <li>He was not actually ignored, but he was pretty firmly dismissed (citing a <a href="https://github.com/rails/rails/pull/4062">prior discussion</a>).</li>
</ul>

<p>Telling someone they're wrong only fuels their desire to prove they're right. It's not a huge surprise that Egor's next step was to demonstrate the vulnerability.</p>

<p>I'd like to explain the vulnerability, but rather than show you any code, I want you to understand the nuts and bolts, because it's <em>extraordinarily</em> simple. If you have a GitHub account, you can <a href="https://github.com/settings/ssh">manage your SSH keys</a>. The form to add a new key looks something like this (edited for clarity):</p>

<pre class="code">
<code>&lt;form method="post" action="/account/public_keys"&gt;</code>
<code>  &lt;input type="hidden" value="412e11d5317627e48a4b0615c84b9a8f" name="authenticity_token" /&gt;</code>
<code>  &lt;dl&gt;</code>
<code>    &lt;dt&gt;Title&lt;/dt&gt;</code>
<code>    &lt;dd&gt;&lt;input type="text" name="public_key[title]" /&gt;&lt;/dd&gt;</code>
<code>    &lt;dt&gt;Key&lt;/dt&gt;</code>
<code>    &lt;dd&gt;&lt;textarea name="public_key[key]" /&gt;&lt;/dd&gt;</code>
<code>  &lt;/dl&gt;</code>
<code>  &lt;input type="submit"&gt;Add key&lt;/input&gt;</code>
<code>&lt;/form&gt;</code>
</pre>

<div class="note"><p>The <code>authenticity_token</code> is almost certainly an <a href="http://shiflett.org/articles/cross-site-request-forgeries">anti-CSRF token</a>, so it doesn't complicate this exploit at all.</p></div>

<p>All Egor did was modify his own form to add the following:</p>

<pre class="code">
<code>&lt;input type="hidden" name="public_key[user_id]" value="4223" /&gt;</code>
</pre>

<p>The <code>user_id</code> of the Rails project is <code>4223</code>, so that's why he chose it. (He believes this is a Rails issue, and it's hard to argue that.) By sending along this <code>user_id</code>, his public key was added to another account. Yikes!</p>

<p>For those of you more familiar with PHP, imagine a feature like <code>register_globals</code>, but instead of injecting arbitrary form data into the global namespace, it injects arbitrary form data into the database. It might as well be called opt-in <a href="http://shiflett.org/articles/sql-injection">SQL injection</a>, but even that's being too generous, because this is much easier to exploit than an SQL injection vulnerability.</p>

<p>Egor points out that <a href="https://github.com/rails/rails/issues/5228#issuecomment-4300754">this vulnerability is unique to Rails</a>:</p>

<blockquote><p>Only Rails app have this kind of bug.</p></blockquote>

<p>Wanting to better understand why <a href="https://github.com/rails/rails/pull/4062">Rails refuses to fix this</a>, I looked into <em>mass assignment</em>, the feature in question, and found <a href="http://enlightsolutions.com/articles/whats-new-in-edge-scoped-mass-assignment-in-rails-3-1">a post from last year</a>:</p>

<blockquote><p>If you're using Rails and you want to be secure, you should be protecting against mass assignment. Basically, without declaring <code>attr_accessible</code> or <code>attr_protected</code>, malicious users can set any column value in your database, including foreign keys and secure data.</p></blockquote>

<p>While it's unfair to expect Rails to prevent mistakes, this does seem like a clear case where it promotes insecurity. As <a href="https://github.com/rails/rails/issues/5228#issuecomment-4311510">one person commented</a>:</p>

<blockquote><p>Rails is all about conventions. Broken by default is not a good convention.</p></blockquote>

<p>Yehuda Katz has proposed <a href="https://gist.github.com/1974187">a solution</a> that people seem to like. Here's hoping this event can help raise the bar for what's expected of a framework. When Zend Framework was first announced, I made <a href="http://shiflett.org/blog/2005/oct/zend-framework-wishlist">a wishlist</a>, because I think frameworks are perfectly suited to help developers write more secure code. Rails is no exception.</p>

<p>If you're interested in reading more about this, here are some links:</p>

<dl>
    <dt><a href="https://github.com/rails/rails/issues/5228">Mass assignment vulnerability - how to force dev. define attr_accesible?</a></dt>
    <dd>The GitHub issue where Egor first discloses the vulnerability.</dd>
    <dt><a href="https://github.com/rails/rails/commit/b83965785db1eec019edf1fc272b1aa393e6dc57">wow how come I commit in master? O_o</a></dt>
    <dd>Egor's commit to Rails, demonstrating the vulnerability.</dd>
    <dt><a href="https://github.com/blog/1069-responsible-disclosure-policy">Responsible Disclosure Policy</a></dt>
    <dd>GitHub's followup post that mentions their new <a href="http://help.github.com/responsible-disclosure/">responsible diclosure policy</a>.</dd>
    <dt><a href="http://homakov.blogspot.com/2012/03/egor-stop-hacking-gh.html">"Egor, stop hacking GH"</a></dt>
    <dd>Egor's original post, describing vaguely what he has been able to do and citing the fact that he feels ignored.</dd>
    <dt><a href="http://homakov.blogspot.com/2012/03/im-disappoint-github.html">i'm disappoint, github</a></dt>
    <dd>Egor's second post, where he proclaims his love for GitHub and disappointment with their response, suspending his account.</dd>
    <dt><a href="http://homakov.blogspot.com/2012/03/how-to.html">How-To</a></dt>
    <dd>Egor's final post, revealing the details of the exploit.</dd>
    <dt><a href="https://github.com/rails/rails/commit/b83965785db1eec019edf1fc272b1aa393e6dc57#commitcomment-1040892">Comment by Max Bernstein</a></dt>
    <dd>References an email conversation with Egor, where Egor claims that he emailed GitHub about the vulnerability and received no response.</dd>
    <dt><a href="https://gist.github.com/1978249">How Homakov hacked GitHub &amp; the line of code that could have prevented it</a></dt>
    <dd>Gist from Peter Nixey that explains a single line of code that can prevent this vulnerability in your own Rails apps.</dd>
</dl>]]></content:encoded>
            <pubDate>Mon, 05 Mar 2012 16:26:51 GMT</pubDate>
        </item>


        <item>
            <title>URL Encoding and Hashbang Hell</title>
            <link>http://shiflett.org/blog/2012/mar/url-encoding-and-hashbang-hell</link>
            <guid>http://shiflett.org/blog/2012/mar/url-encoding-and-hashbang-hell</guid>
            <description><![CDATA[Thanks to reader Steve Gricci, I have learned that BackTweets no longer exists, presumably because BackType was acquired by Twitter. (Regardless, why let the domain expire?) Until today, I have been using BackTweets for the "tweets" link at the top of ea&#8230;]]></description>
            <content:encoded><![CDATA[<p>Thanks to reader <a href="http://twitter.com/sgricci">Steve Gricci</a>, I have learned that BackTweets no longer exists, presumably because <a href="http://backtype.com/">BackType was acquired by Twitter</a>. (Regardless, why let <a href="http://backtweets.com/">the domain</a> expire?) Until today, I have been using BackTweets for the "tweets" link at the top of each post, so anyone who clicked it recently was greeted by a parked Go Daddy page instead of seeing all tweets related to a particular post. Yikes!</p>

<p>My quick fix is to use Twitter instead, but their <a href="http://shiflett.org/blog/2011/feb/javascript-and-urls">hashbang URLs</a> make it difficult to link directly to anything. Thankfully, if you want to search for tweets that mention something simple like <code>brooklynbeta</code>, you can use an ordinary URL like this:</p>

<p class="url"><a href="http://twitter.com/search/brooklynbeta">http://twitter.com/search/brooklynbeta</a></p>

<p>No hashbang. It just works. Nice! Maybe this will be easy after all. Let's try a search for a URL:</p>

<p class="url"><a href="http://twitter.com/search/http://twitter.com/">http://twitter.com/search/http://twitter.com/</a></p>

<p>Account suspended? That's weird. While this error message isn't very helpful (maybe @search is the account that was suspended), the fault in this case is ours. We're using a query that has special characters, but we didn't bother to URL encode it. Our bad. Let's try that again:</p>

<p class="url"><a href="http://twitter.com/search/http%3A%2F%2Ftwitter.com%2F">http://twitter.com/search/http%3A%2F%2Ftwitter.com%2F</a></p>

<p>The page doesn't exist? But, we're doing the right thing now! Okay, fine, maybe we have to use the hashbang URL after all:</p>

<p class="url"><a href="http://twitter.com/#!/search/http%3A%2F%2Ftwitter.com%2F">http://twitter.com/#!/search/http%3A%2F%2Ftwitter.com%2F</a></p>

<p>Hooray! Well, almost. If this works for you, I recommend going to your <a href="http://twitter.com/settings/account">Twitter settings</a> and checking the box to always use HTTPS. Once you've done this, you'll be told the page doesn't exist. It seems that Twitter is decoding the query when it redirects. Maybe we can just URL encode it twice to compensate for Twitter's decoding?</p>

<p class="url"><a href="http://twitter.com/#!/search/http%253A%252F%252Ftwitter.com%252F">http://twitter.com/#!/search/http%253A%252F%252Ftwitter.com%252F</a></p>

<p>Hooray! But wait, what if we don't check the box to always use HTTPS? We won't get redirected, so Twitter won't decode our query. We'll actually be searching for <code>http%3A%2F%2Ftwitter.com%2F</code> instead of <code>http://twitter.com/</code>. What can we do? We can do this:</p>

<p class="url"><a href="https://twitter.com/#!/search/http%3A%2F%2Ftwitter.com%2F">https://twitter.com/#!/search/http%3A%2F%2Ftwitter.com%2F</a></p>

<p>Because Twitter doesn't redirect HTTPS to HTTP, this avoids the redirect, regardless of the user's settings. Hooray?</p>

<p>There is a lesson here. URLs are underrated. Making it extremely easy and obvious for users to link to your content should be a priority. Let's try our best to remember this, even when it seems difficult to push the Web forward without abandoning its past.</p>

<div class="note"><p>Luckily, it sounds like <a href="http://www.webpronews.com/twitter-hashbang-urls-will-soon-be-a-thing-of-the-past-2012-02">Twitter hashbang URLs will soon be a thing of the past</a>. That's very good news.</p></div>]]></content:encoded>
            <pubDate>Sun, 04 Mar 2012 18:49:18 GMT</pubDate>
        </item>


    </channel>
</rss>

