
jQuery.fn.blogNews = function(category, limit) {
    return this.each(
        function() {
            var dest = $(this);

            if (!limit) limit = 2;

            jQuery.get('scripts/ajax.php',
                  {
                      q:    'get-page',
                      page: 'http://jdegoes.squarespace.com/journal/category/' + category
                  },
                  function(xml) {
                      var cur = 0;

                      $('h2.title a', xml).each(
                          function() {
                              if (++cur > limit) return false;
                              
                              var linkObj = jQuery(this);

                              var link  = 'http://jdegoes.squarespace.com/' + linkObj.attr('href');
                              var title = linkObj.html();
                              var desc  = linkObj.parent().parent().find('p').html();

                              dest.append('<p><a href="' + link + '">' + title + ':</a> ' + desc + ' <a href="' + link + '">[more]</a>' + '</p>');
                          }
                      );
                  },
                  'text'
            );
        }
    );
}