There are some Blogger gadget for sending reader to a random post, but they are gadgets, you need to put them into layout. Sometimes, it might not look good, especially you have a custom template.

For me, I am not fond of such thing, so you won’t see this on my blog, but it’s easy to code. Here is a quick result:

And the code

<script>
/* Simple Random Posts function for Blogger
 * Copyright 2012 Yu-Jie Lin
 * Licensed under the MIT License
 */
function blogger_random_post(){
  // You can replace the value with your blog ID
  var blogID = $('#blogID').val();
  // for example:
  //  blogID = "3803541356848955053";
  var BLOGGER_POSTS_API = "http://www.blogger.com/feeds/blogID/posts/summary";
  // appending necessary parameters
  BLOGGER_POSTS_API += "?alt=json-in-script&max-results=1&callback=?";
  // replacing blogID with value
  BLOGGER_POSTS_API = BLOGGER_POSTS_API.replace('blogID', blogID.toString());
  $('#btn-blogger-random').text('Tossing dice...');
  // retrieving posts count
  $.getJSON(BLOGGER_POSTS_API, function(data){
    var posts_count = parseInt(data.feed.openSearch$totalResults.$t);
    // index is 1-based
    var index = Math.floor(Math.random() * posts_count) + 1;
    // retrieving post link
    $.getJSON(BLOGGER_POSTS_API + '&start-index=' + index, function(data){
      $.each(data.feed.entry[0].link, function(idx, link){
        if (link.rel == 'alternate')
          // redirecting
          document.location.href = link.href;
      });
    });
  });
}
$(function(){
  $('#btn-blogger-random').click(blogger_random_post);
});
</script>
<label>Blog ID <input id="blogID" value="3803541356848955053"/></label>
<button id="btn-blogger-random">I'm Feeling Lucky &raquo;</button>

It is not quite efficient for retrieved data from Blogger API, it makes two requests, one for posts count, another for the random post’s link. Blogger will send a huge list of labels if your blog has a lot of labels. However, it is still not too bad.

It only requires jQuery library and you can pretty much put that button anywhere you like with CSS. Even use an image or text line, etc. That’s something gadgets can not give you. Of course, you need to know one or two things about webpages.

If you are interested in putting this into your stuff, feel free to leave questions in comments if you have any problems.