Saturday, February 18, 2012

Comparing blog-order hacks #1: Reliability now and tomorrow

You can show your blog content in its original posting order, oldest first.

There are several approaches you can take, none perfect, as described here.

One way bypasses one set of problems by using third-party web services. Another bypasses problems with web-services by using Blogger's own architecture.

Which is best for your blog? Consider which is likeliest to hold up over time.

In this case, compare a web-services solution that I created and document on this blog with a newer script-based approach created by a Finnish programmer whose chosen Blogger name is MS-Potilas.

It's not a slam-dunk, but the new method is very promising.

A key issue for me in evaluating these methods is reliability. Changes to web services can ripple though web-services methods, requiring users to scurry to compensate.

Last year for instance Yahoo Pipes decided to paginate its feeds at 100 posts, affecting anyone using my web-services method on blogs of more than that.

I posted the workaround, but what a pain in the neck! I felt badly for everyone I had convinced to use my solution.

However, there is an equivalent issue for scripts that reorder content without thrid-party web services. Changes in how Blogger works, or in how different browsers work, can have similar side effects.

Recently for instance Blogger rolled out a new commenting feature that screwed up comments on many blogs.

These changes can and do break script-based hacks regularly.

My web-services method was in response to that: a popular javascript-based solution no longer worked on some browsers. These approaches kept breaking.

Web services let us avoid that problem by taking the blog content, in the form of the blog feed, completely out of the blog, manipulating it, then returning it to the blog as a script you just paste onto any static page. Brilliant, unless the web services fail.

I quizzed MS-Potilas about the robustness of his no-web-services script-based hack. Might it break someday as browsers continue to evolve?

No, in his view because "Javascript DOM [Document Object Model] handling is solid, so it won't break on future browsers."

Of Blogger itself he says
I don't think Google/Blogger will change the "old" (layout) templates, which the script works with, so DOM should keep intact, and DOM handling in javascript is done in just basic javascript, no tweaks or anything that might break on browser update.

Of course there is slight possibility that they change something so radically, that the script breaks, but that would be very difficult, with people having their customized templates, without breaking many other things at the same time.

For future templates the script might not work, but for current, it should not break.
I am a glass-half-empty kind of guy about these things, so I take this with a grain of salt. But just a grain.

See my conversation with MSP about these (and other) questions if you'd like to evaluate for yourself.

A related issue has to do with the maintenance of these solutions.

Any blog tweak can feel daunting and confusing and with the potential for error; it's a good idea to back up your template and make a disciplined little production out of every such change. But once you've done it, and it works, it's great and you are done with it.

That's how my hack worked a year ago, but thanks to changes in Yahoo Pipes last fall, no longer. Pipes now segments the hack into blocks of 100 posts. A blog of 350 posts needs four iterations, not one, to show all the content in chronological order.

Worse yet from my point of view, as that blog adds posts (at the 400, 500, 600-post mark, ad infinitum), additional scripts are required.

One hundred posts is a lot, depending on how you blog. But if you use Yahoo Pipes, as I do, you will never be done with the need to tinker. As of this writing, that is not true of the Finnish solution.

That is why I recommend that bloggers seeking to flip their blog content give MS-Potilas's script a try first.

If it doesn't work for you (and it may not) or if it breaks someday, then my blog-journey hack has the virtue of independence from changes to browsers and Blogger alike.

Comparing blog-order hacks #1: Reliability now and tomorrow

You can show your blog content in its original posting order, oldest first.

There are several approaches you can take, none perfect, as described here.

One way bypasses one set of problems by using third-party web services. Another bypasses problems with web-services by using Blogger's own architecture.

Which is best for your blog? Consider which is likeliest to hold up over time.

Thursday, February 16, 2012

Easier (mostly), better (mostly) way to reverse blog-post order

Two years ago I introduced a method for showing your blog's content in the order you wrote it, oldest first.

For the past few months I have been testing a promising new way to do the same thing.

When it works it is very good. Here is how it looks on this blog. It took me less than five minutes to install.

If you want to show your blog content oldest-first, I recommend trying this one out before resorting to the method I created. How's that for an endorsement?

No method for reordering blog content is perfect, however. Here are some pros and cons.

Though there is some logic to Blogger's default reverse order, first-post-first is especially useful for travel bloggers or anyone who wants to show their blog as a journey progressing over time.

Towards that end, I spent time on this blog documenting one method of reordering posts with your blog's feed and third-party web services. The justification for this approach has been somewhat eroded by changes in those services.

The new approach, from a retired programmer in Finland called MS-Potilas, uses a script to maniplate elements within Blogger. This approach has the following advantages compared to my blog-journey hack.
  • You don't have to learn as much. Blog feeds, Yahoo Pipes, all of that stuff that my hack uses--not needed here.
  • Tight integration with Blogger architecture. It's possible to format my hack to look like a page of blog posts in oldest-first order, though some post elements (such as comment links or labels) are absent.
    The Finnish solution, however, shows the actual posts on a kind of specialized blog archive page, complete with "older posts" and "newer posts" navigational links if your blog has them. No formatting is required and all posts elements are present.
  • Works with private blogs. Private blogs do not have feeds, so feed-based solutions like mine don't work for them.
  • Immunity from changes in third-party web services. If feed2js.org goes out of business, it doesn't leave you scrambling to find a new feed-to-script service. Update: A bit more on this point here.
  • Do it once only. No need to tweak things as your blog grows.
Here are the disadvantages compared to the web-services approach.
  • It doesn't work for every blog template, reportedly, especially older ones. And it may not work in the future, if template architecture changes again.
  • It is vulnerable to changes in Blogger and in browser technology. This is the flip side of not using web services.
  • You have to paste some javascript into your template in the right spot. MS-Potilas walks you through this, but if you do not know javascript there is an element of flying blind. Also, as I discuss below, non-programmers lose some functionality.
  • It doesn't reverse the order of multiple posts within the same day, though the author describes a workaround for that.
Note that the author, MS-Potilas, has a number of ingenious Blogger hacks on his blog. One of these is another oldest-first script that puts up to 500 blog posts, in chronological order, on a static page.

I like his first method better, but if you really want to be thorough you can check this one out too.

Here's something that I think the web services do better than MS-Potilas's script. They are easier to customize. If you want something a little different, like a list of post titles only that are ordered alphabetically (not chronologically) to put in a sidebar gadget, use web services.

I'm sure MS-Potilas could easily knock off a version of his script that would do the same thing. But you can't do it, unless you are a programmer. The web services have handy user interfaces that let anyone slice and dice the content without ever typing, or understanding, a line of code.

The same kind of usability for the masses is a key feature of Blogger and is something I really appreciate wherever I find it. Fortunately, if you need something like the alphabetical sidebar list you can use web services to make it even if you also use the Finnish script to reorder your blog's content.

Here's my blog-journey hack and here's the new kid on the block from MS-Potilas.

Update: I've written a comparison of four leading methods to flip your blog-posting order.

Easier (mostly), better (mostly) way to reverse blog-post order

Two years ago I introduced a method for showing your blog's content in the order you wrote it, oldest first.

For the past few months I have been testing a promising new way to do the same thing.

When it works it is very good. Here is how it looks on this blog. It took me less than five minutes to install.

If you want to show your blog content oldest-first, I recommend trying this one out before resorting to the method I created. How's that for an endorsement?

No method for reordering blog content is perfect, however. Here are some pros and cons.