AutoCorrect 0+1i

Categorization is hard. There's a reason library science is a recognized degree program. Blosxom gives you all the flexibility of a hierarchical filesystem to use to categorize items, but with a drawback — if you change a category hierarchy, then old category-based links (whether they're internal links, peoples' bookmarks, links from other weblogs, or search engines) don't work.

Until now.

If a category-based link is used that doesn't correspond to an existing file, the AutoCorrect plugin will look for where it's moved to. If it's reasonably sure it's found the right thing, it simply displays it, almost as if the URL were still right (with the standard templates, a note is added that the item has moved). If it finds some good possibilities but can't make up its mind, it offers a list. If it can't even find good possibilities, it at least offers a semi-explanation and an apology.

Installation is almost as simple as a Blosxom plugin's can be:

  1. download and unzip the plugin.
  2. Copy the plugin to your plugins directory
  3. Test it. Browse your blog, follow permalinks, make sure they work as expected. Edit an URL to remove a directory from it, rendering it invalid; see if you get the right story any way. Maybe create stories with duplicate filenames, and repeat the test with that name.
  4. Look at your error log. Verify you have lines like the following. If it's missing, the plugin isn't getting enabled for some reason &mdash it may not be in the right directory, may not be readable, may have an illegal character in its filename, or may be something else we haven't discovered yet. If you do have that line, but it doesn't seem to be working, set $debug_level to 2 and try again, and send me the results.
    autocorrect debug 1: start() called, enabled
    
  5. Once you're satisfied it's working, edit the plugin's only configuration variable — change $debug_level from 1 to 0. Important: if you don't do this, it will continue to fill up your error log with debug information.
  6. Verify once more it's working satisfactorily. If not, your text editor may not be getting along well with perl -- did it change permissions on the file? Did it change line endings?
  7. Drop me a note letting me you're using it and how things are working for you.
  8. Enjoy!

Limitations, bugs, and to do:

  1. Requires at least Blosxom 2.0 beta 3
  2. Not useful with static-only setups
  3. Only recognizes exact filenames. I should investigate what mod_speling does; is there a standard 'fixing typo' algorithm?

You can try it out in my test bed, if that happens to be working at the moment.

2003-02-25 23:09:00 | Comments (4) | TrackBack (0) | Computers::Internet::Web::Blosxom::Plugins::AutoCorrect

Trackback Pings

TrackBack URL for this entry:
http://molelog.molehill.org/~jtl/mt/mt-tb.cgi/580

Comments

Fletcher

I downloaded autocorrect, and it worked perfectly on my local installation (Mac OS X 10.2.4). Then I installed it on my live site at freeshell.org. It would crash during load due to an error on line 75.

I was able to fix this by changing path_info() to $blosxom::path_info. This allows it to load, but it doesn’t seem to work properly. And when I go to a valid link ending in .html, it gives me a page not found error, but redirects me to the exact same page I entered. (Just as your site does… But I just realized your site only chokes on html, not on writeback.…)

I am not sure if these two problems are related, but I was wondering if you had given any thought to this.…

Thanks, and it has potential to be a great plugin if the last few bugs can get worked out!!!!

2003-04-10 11:51:00

Todd Larason

The path_info() problem can probably be fixed by replacing it with CGI::path_info(). I’m not sure why some systems need the CGI:: and some don’t.

The second problem I can’t reproduce, at least not on my site — valid .html links work fine, as far as I can tell. Can you give an exact example?

2003-04-10 17:41:00

Fletcher

I changed it to CGI::path_info() and now it seems to be working fine.

Thanks!!!

PS> As for the “error” on your site, I think I was so tired of looking at the file not found warning on my site that I didn’t notice that their was a difference between the url I clicked and the page I was shown. My bad!!

Thanks again!!!!

2003-04-11 11:44:00

Fletcher

Could the issue be related to Blosxom having it’s own $path_info variable? Just a thought… Perhaps the source should be changed to CGI::path_info() by default?

2003-04-11 12:00:00

Post a comment




Remember Me?

(you may use HTML tags for style)