$(function () {
  var byTime = [["2012-02-21T01:23:36.247Z","skin"],["2012-02-20T22:19:57.184Z","face-of-the-faceless"],["2012-02-15T17:59:07.871Z","where-is-the-platform"],["2012-02-03T22:11:08.102Z","promotion"],["2012-01-07T01:01:41.291Z","prioritization"],["2011-12-10T21:37:22.146Z","nodemodules-in-git"],["2011-11-30T20:30:54.865Z","the-value-of-institutions"],["2011-11-22T23:34:05.469Z","apache-considered-harmful"],["2011-11-11T21:44:58.955Z","what-is-the-maximum-number-of-courses"],["2011-10-27T19:05:22.796Z","is-hn-negative-by-design"],["2011-10-26T19:46:12.607Z","foreclosured"],["2011-09-27T10:39:46.057Z","a-new-direction-for-web-applications-"],["2011-09-02T20:38:00.518Z","remember-with"],["2011-09-01T21:47:17.815Z","responsibility"],["2011-08-02T23:23:09.616Z","a-little-test-server"],["2011-08-01T20:56:36.966Z","nodecommit-panel-editing"],["2011-08-01T20:37:48.294Z","context-switches"],["2011-07-30T19:39:03.088Z","programming-minimalism"],["2011-07-29T21:18:41.353Z","request-20"],["2011-07-19T22:40:44.571Z","identifying-patterns---nexttick"],["2011-07-19T03:32:43.170Z","identifying-patterns---streams-"],["2011-07-16T02:36:29.137Z","identifying-patterns"],["2011-07-06T00:24:51.625Z","a-summer-camp-for-nodejs"],["2011-06-02T00:40:13.742Z","on-meetups"],["2011-05-20T21:06:45.699Z","companies-and-communities"],["2011-02-01T19:18:04.112Z","hello-yammer"],["2011-01-03T22:15:09.286Z","jspp-initial-performance"],["2010-12-11T22:25:39.240Z","the-meaning-of-linux"],["2010-11-08T07:24:01.626Z","new-blog"],["2010-09-16T07:00:00.000Z","relaximation-take-two"],["2010-08-01T07:00:00.000Z","abstracting-couchdb"],["2010-07-22T07:00:00.000Z","nyc-node-js-meetup-this-saturday-july-24th"],["2010-07-19T07:00:00.000Z","no-more-comments"],["2010-07-16T07:00:00.000Z","tech-that-is-not-tech"],["2010-07-07T07:00:00.000Z","mongodb-performance-durability"],["2010-06-30T07:00:00.000Z","couchdb-builtin-reduce-functions"],["2010-06-29T07:00:00.000Z","couchup-thursday-6pm-at-pacific-coast-brewery-oakland"],["2010-06-22T07:00:00.000Z","open-source-bbq-sunday-june-27th-2010"],["2010-05-04T07:00:00.000Z","performance-testing"],["2010-04-06T07:00:00.000Z","open-source-bbq-this-friday-492010"],["2010-02-24T08:00:00.000Z","atomic-increments-in-couchdb"],["2010-02-08T08:00:00.000Z","ch-ch-ch-changes"],["2010-01-02T08:00:00.000Z","moving-on"],["2009-11-29T08:00:00.000Z","hosting"],["2009-11-20T08:00:00.000Z","json-performance-in-python"],["2009-11-04T08:00:00.000Z","couchdb-view-performance-python-vs-javascript"],["2009-10-28T07:00:00.000Z","introducing-couchdb-wsgi"],["2009-08-05T07:00:00.000Z","mutual-benefit"],["2009-07-21T07:00:00.000Z","economics-of-web-fonts"],["2009-07-20T07:00:00.000Z","github-is-the-winner"],["2009-07-20T07:00:00.000Z","dead-font-walkin"],["2009-07-15T07:00:00.000Z","duke-nukem-os"],["2009-07-02T07:00:00.000Z","up-for-a-pint"],["2009-06-26T07:00:00.000Z","heading-to-europython"],["2009-06-15T07:00:00.000Z","conference-season-begins"],["2009-05-13T07:00:00.000Z","rip-annotations-remix"],["2009-04-29T07:00:00.000Z","professionals-or-people"],["2009-04-28T07:00:00.000Z","video-just-feels-good"],["2009-04-23T07:00:00.000Z","cant-blame-the-user-blame-the-user-community"],["2009-04-07T07:00:00.000Z","windmill-11-the-pycon-release"],["2009-04-05T07:00:00.000Z","on-test-recorders"],["2009-03-25T07:00:00.000Z","windmill-10"],["2009-03-24T07:00:00.000Z","introducing-webenv"],["2009-03-12T07:00:00.000Z","multiple-feed-rels-are-a-bad-idea"],["2009-03-11T07:00:00.000Z","education-as-an-institution"],["2009-03-05T08:00:00.000Z","mozmill-11-released"],["2009-03-01T08:00:00.000Z","need-sphinx-hosting"],["2009-02-21T08:00:00.000Z","whiskyfest-chicago"],["2009-02-18T08:00:00.000Z","introducing-pushmarks"],["2009-02-15T08:00:00.000Z","product-review-eyefi-explore"],["2009-02-14T08:00:00.000Z","pycon-chicago-2009"],["2009-02-03T08:00:00.000Z","want-to-learn-python"],["2009-01-28T08:00:00.000Z","breaking-a-bad-habit"],["2009-01-16T08:00:00.000Z","getting-unique-lines-in-a-text-file"],["2009-01-10T08:00:00.000Z","book-review-expert-python-programming"],["2009-01-06T08:00:00.000Z","strip-maul"],["2009-01-02T08:00:00.000Z","product-review-flip-mino-hd"],["2008-12-18T08:00:00.000Z","mozmill-http-server-api"],["2008-12-18T08:00:00.000Z","fireunit-first-impressions"],["2008-12-05T08:00:00.000Z","will-people-buy-fuel-efficient-american-cars"],["2008-12-04T08:00:00.000Z","new-bike"],["2008-12-03T08:00:00.000Z","processing-a-json-stream"],["2008-12-02T08:00:00.000Z","using-the-mozmill-menu-api"],["2008-12-02T08:00:00.000Z","using-mozmill-for-unittests"],["2008-11-29T08:00:00.000Z","mozmill-10rc2-w-test-recorder"],["2008-11-24T08:00:00.000Z","obamas-unacceptable-position"],["2008-11-04T08:00:00.000Z","mandatory-election-day-post"],["2008-11-02T07:00:00.000Z","running-windmill-tests-from-django"],["2008-10-28T07:00:00.000Z","introducing-jsbridge"],["2008-10-23T07:00:00.000Z","ubiquity-command-for-docspythonorg"],["2008-10-13T07:00:00.000Z","windmill-091-released"],["2008-10-13T07:00:00.000Z","mozmill-beta2-released"],["2008-09-28T07:00:00.000Z","mozmill-beta-released"],["2008-09-28T07:00:00.000Z","introducing-django-mako"],["2008-09-19T07:00:00.000Z","yet-another-couchdb-library"],["2008-09-16T07:00:00.000Z","a-bad-disney-film"],["2008-09-13T07:00:00.000Z","you-too-can-use-a-macbook-air"],["2008-09-08T07:00:00.000Z","firebug-lite-in-windmill"],["2008-09-08T07:00:00.000Z","djangocon-2008"],["2008-09-06T07:00:00.000Z","windmill-reporting"],["2008-08-29T07:00:00.000Z","windmill-has-moved"],["2008-08-29T07:00:00.000Z","introducting-mozrunner"]]
  $('<div id="loadmore" style="text-decoration:underline;color:blue;cursor:pointer;">Load older posts.</div>')
  .click(function () {
    $(this).remove();
    var onemore = function () {
      var l = $('div.index-post').length
      if (l !== byTime.length) {
        $.ajax({url:'/db/'+byTime[l][1]+'.json', success: function (doc) {
          var newpost = $(
            '<div class="post index-post">' +
              '<div class="title"><a href="posts/'+doc._id+'.html"></a></div>' +
              '<div class="created">' + new Date(doc.created).toString("MMM d yyyy") + '</div>' +
              '<div class="body_html"><p>"<a class="article-link" href="posts/'+doc._id+'.html"></a>"</p></div>' +
            '</div>'
          )
          newpost.find('div.title a').text(doc.title)
          newpost.find('div.body_html a.article-link').text($($('<div>'+doc.body_html+'</div>').find('p')[0]).text())
          newpost.appendTo('div#content')
          onemore();
        }})
      }
    }
    onemore();        
  })
  .appendTo('body')
})

