Category archives for Geekery

Thursday, December 14, 2006

Sidebar 2.0

New stuff. Woo! You'll note the sidebar is moved from the left to the right. The sidebar now appears after the content column in the code. You'll also note the sidebar no longer overlaps the content column. That feature was pretty, but a huge pain in the ass. I always had to be careful with where I placed floats and I was never able to get all the cross browser margins sorted out.

Under the hood, the entire template was rewritten from scratch. Before this, I'd been using the same template for the better part of a year. Constant tweaking and an endless parade of plugins running through with dirty feet was beginning to leave my code a little muddled. Well, no more. Now it's cleaner and more organized. It's easier for me to maintain and easier for the curious to sort out what I'm doing when they view the source. Sadly, this rewrite left the other blog skins behind. I may add some of them back later. Maybe. The older skins might not work quite so well with the big new feature…

…the new sidebar! You'll see the sidebar is now broken into separate boxes. If you click the title bar of any box, you can click and drag to reorder the sidebar to your liking. If you check the right end of each box's title bar, you'll see a little arrow icon. Click that arrow and the box will contract. Click it again and it will expand. So each user now has the ability to collapse the sidebar items they use infrequently and to reorder the sidebar to place the items they use often at the top. Best of all, and unlike my previous setup, your preference will be remembered between visits.

WordPress users might recognize the idea behind the sidebar. I stole it from the WP post editor. When I first started using WP I thought, "Wow, that's cool. How does that work?" When I finally got around to digging into it I leaned it's a script from Brothercake called docking boxes. All the supermagic voodoo should be compatible with IE6/7, Opera 8/9 and Firefox 1.0.x/1.5.x/2 (and anything else using Gecko 1.7 or better).

There are new goodies in the sidebar, too. The old Meta section is now expanded into three separate, more logical sections. I've also added my del.icio.us links, a list of recent links to me and a custom flickr badge.

I've been beating this new template into shape for the past week or two and it think it's finally polished enough to "go live." Of course, I'll probably be chasing bugs for the next month as I find little things that slipped under the radar the first time around. If you could help out with that a bit, I'd appreciate it. Be a pal and let me know if you find anything wonky, won't you?

Monday, December 4, 2006

How-to: Import posts and comments from Blogger Beta into WordPress

(And into ExpressionEngine and Movable Type, too!)

Update: If you're migrating to WordPress, you might want to check out a shiny new WordPress plugin before you get into all my manual tomfoolery. I haven't had a chance (or a need) to test it, but Import New Blogger looks fast and painless.

Update 2: Supposedly WordPress 2.2 and higher natively support importing from "new" Blogger. These instructions are likely now completely irrelevant for WordPress, but should still work just fine for migrating to MT or EE.
 

You know I'm a general, all-purpose fix it guy, right? As snarky and bitchy as I can be about my job, it really is a great fit for me. I genuinely like helping people. In that same vein, as I'm sure most of you have noticed, I've kind of positioned myself as "the answer guy" to a lot of people for just about anything blogging related.

One of the questions I'm asked most often is, "How do I get my Blogger Beta posts and comments into WordPress?"* Anyone who's tried this knows that the import script currently available with WP (even in the bleeding edge developer versions) doesn't support Blogger Beta.

There already exist several workarounds that will allow someone to do this very thing. Unfortunately none of them are ideal. They'll either not import comments, or they'll only import recent posts or they're far too complex for ordinary mortals. I've always thought there must be a better way. In the absence of a proper WP import script, here then is what I've come up with.** This method works for importing into WordPress, Movable Type and Expression Engine. It also works for WordPress.com users, but with a very big caveat in step five.

Step one: tweaking Blogger Beta's settings

Login to Blogger Beta and visit the Settings tab of the control panel for the blog from which you'll be importing. Select the Formatting page. Change the setting for Timestamp format to mm/dd/yyyy hh:mm:ss like you see in the first image below (all images are hyperlinked to larger versions).

Blogger Beta screencap

While still on the Formatting page, set both Convert line breaks and Enable float alignment to "No."

Blogger Beta screencap

Click the Save Settings button at the bottom of the page to proceed.

Now select the Comments page, and there change the setting for Comments timestamp format to mm/dd/yyyy hh:mm:ss, just as you did for the post timestamps.

Blogger Beta screencap

Click the Save Settings button to move on.

Select the Archiving page. Set Archive Frequency to Monthly.

Blogger Beta screencap

Click Save Settings.

Step two: your Blogger Beta template

Now select the Template tab.

If you are using a Beta-style template, visit the Edit HTML page and there click the link for Revert to Classic Template

Blogger Beta screencap

You'll be prompted to confirm this and advised that your Beta-style template will be saved.

Now you're ready to continue regardless of what style template you were using. (So classic-style template users should start paying attention again.)

If your classic-style template contains any customizations, make a backup of your template now. Do this by copying the template from the Edit HTML page and pasting it into Windows Notepad or some other similar plain text editor. I can't stress this part enough. We're going to do something irreversible to the template so a manual backup is the only way to preserve your changes. Blaming me for losing your blogroll because you didn't follow the steps will create a curse upon your family.

Once your backup is safely tucked away, kill the entire template (in the Blogger control panel, not in your backup [can't stress that enough]) and replace it with this:

<?php header("Content-type: text/plain"); ?><Blogger>TITLE: <$BlogItemTitle$>
AUTHOR: <$BlogItemAuthorNickname$>
DATE: <$BlogItemDateTime$>
STATUS: publish
-----
BODY:
<$BlogItemBody$>
<BlogItemCommentsEnabled><BlogItemComments>-----
COMMENT:
<?php $comment<$BlogCommentNumber$> = '<$BlogCommentAuthor$>';
$comment<$BlogCommentNumber$>_author_pre = explode('>', $comment<$BlogCommentNumber$>);
$comment<$BlogCommentNumber$>_author = explode('<', $comment<$BlogCommentNumber$>_author_pre[1]);
echo "AUTHOR: " . $comment<$BlogCommentNumber$>_author[0] . "\n";
$comment<$BlogCommentNumber$>_url_pre = explode('href="', $comment<$BlogCommentNumber$>);
$comment<$BlogCommentNumber$>_url = explode('" rel="', $comment<$BlogCommentNumber$>_url_pre[1]);
echo "URL: " . $comment<$BlogCommentNumber$>_url[0] . "\n"; ?>
DATE: <$BlogCommentDateTime$>
<$BlogCommentBody$>
</BlogItemComments></BlogItemCommentsEnabled>--------
</Blogger>

Before going farther, a few words about this template. It's essentially an ugly hack of Movable Type's import/export format. Possibly incomplete details on the format can be found here. I say "possibly incomplete" because I can't find any details about the STATUS: publish bit. Since I found that bit in the WordPress Codex, it's possible that field is not part of the official specification and thus may not be supported by the importers built into MT or EE.

And while we're on the subject of the STATUS: field, the other option is "draft." Draft is probably the preferred option, as it will allow you to edit imported entries as required before they become part of your new blog, but manually publishing every new draft could be a massive chore if you have many posts. Replace STATUS: publish with STATUS: draft (or remove that line completely) at your preference.

When you're ready, click Save Template Changes.

Now view your blog. You'll note that it's disgustingly fugly. If you care to try to read any of it, you'll probably also note that none of the PHP has been processed. If you view the source of your page, you'll see the PHP tags sitting there ignored.

Update: A user has reported difficulty with step six when using Internet Explorer. If you're still using IE, it's time to move up to a better browser. If you can't (or won't) use a different browser, you may have better luck on step six if you edit this template to remove <?php header("Content-type: text/plain"); ?> from the first line. I thought manually specifying the output content type would increase compatibility, but it just might be having the opposite effect.

Step three: download the blog

Visit each of your monthly archive pages. Since you don't have a list of clickable links, you'll have to type the addresses manually. The structure of the archive URLs are like so: http://yourblog.blogspot.com/2006_12_01_archive.html. For each month of your archives, you'll need to change month and year in the URL. This could be a little time consuming if your blog has been around for a while. It would be nice if Blogger had yearly archives, but we've got to roll with what we've got.

You'll need to save each of your archive pages to your computer. In Firefox, select Save page as… from the File menu. In Opera, select Save as…, also on the File menu. In Internet Explorer 6 and lower, Save as… is found on the File menu but in IE7, you'll find it on the Page menu. Whatever web browser you're using, be sure to save your page as "All files" if it's available, or "text files" if it's not. Replace the .html extension with .php.

Blogger Beta screencap

When you're all finished, you'll have one file for each month of your Blogger archives. Those files should be named like so:

2006_12_01_archive.php
2006_11_01_archive.php
2006_10_01_archive.php
2006_09_01_archive.php

…and so on.

And you're ready for the next step.

Step four: remove Blogger's mess

Open one of your new PHP files with a plain text editor like Windows Notepad.

You've got to get rid of that Blogger bar foolishness. Do this by removing the first four lines and part of the fifth. Everything before has got to go.

Blogger Beta screencap

Save the file. Repeat this process for each of your monthly archives.

Step five: upload to your webspace

Now you'll need to get your PHP files onto your webspace. Do this any way with which you are comfortable: FTP, cPanel upload, whatever. I'd recommend placing them right in the root of your webspace for short URLs, but it doesn't really matter where you place them because they won't need to stay there permanently.

For WordPress.com users only: all of the steps in this process are completely compatible with your service, except this one. But all is not lost. If you've got a pal who's willing to host your few files for a while, that's all you really need.

Step six: saving again

Load the URL for each of your uploaded files in your web browser. You'll see your output is dramatically different.

Blogger Beta screencap

Without the Blogger gobbledygook, and after PHP has specified text/plain and parsed comment author links into separate AUTHOR/URL fields (if Blogger had separate template tags for those, this would be a lot simpler) we've got a proper, well-formed mt-import file. Yee-haw.

Now to save them. For each file, select Save as… again from the File menu (or whatever the command is for your browser). Set the file type to text and give your files a txt extension. Since this time the content type is set properly, you likely won't need to change anything, but you'll still need to double check.

Blogger Beta screencap

Now you'll have a lovely set of well-formed mtimport files with names like these:

2006_12_01_archive.txt
2006_11_01_archive.txt
2006_10_01_archive.txt
2006_09_01_archive.txt

And now we're ready to move on.

Step seven: importing (finally!)

We're in the home stretch here. The actual import process is easy as pie.

For WordPress users: In your Dashboard, look for Import as one of the top level options. You'll see "Movable Type and Typepad" on the list. Click that link and the very simple MT import wizard will begin. If you need assistance with this bit, check out the very detailed documentation and examples in the Codex. (Note that WordPress.com and the current 2.1 development versions of WordPress have the importers as a subpanel of the Manage page.)

For ExpressionEngine users: Upload your set of text files to your webspace (EE doesn't upload as part of the import). In your Control Panel, visit Admin -> Utilities -> Import Utilities -> Movable Type Import Utility. I'm really not an EE guy, so if you need assistance, you should visit pMachine's EE forums or check out this page in the EE wiki.

For Movable Type: I don't even have an MT installation anymore, so I really don't know how to direct you. This page in Six Apart's MT documentation would probably be a great place to start.

Step eight: clean up your own mess

Nothing remains now but mop-up. Delete all the temporary files from both your webspace and your own hard drive, although you might want to keep those text files. They're a neat, human readable backup of your blog. Can't hurt to keep.

Put your Blogger template back the way it was. If you made a backup of your classic style template (and you did, right? 'cuz I stressed that… a lot), restore it now. If you were using the Beta style template, "upgrade" from classic back to the template you had before.

Adjust Blogger's settings on the Formatting, Comments and Archiving pages back to their original values, or to whatever other settings you might prefer.

If you elected to replace STATUS: publish with STATUS: draft, you'll still need to review, edit and publish each of your imported posts.

Step nine: drink beer

You're done!

 

*In case you were wondering, the question I'm asked more than any other is, "What happened to my gravatars?" (go back up)

**Now that I've put forth all this effort, would you care to wager how quickly WordPress will have an update for the built-in importer? (go back up)

Thursday, November 30, 2006

Damn him all to hell

So apparently Michael Douglas almost killed himself.

Douglas briefly lost his footing while standing in a cherry-picker basket 25 feet in the air to christen a new art museum in Bermuda. Douglas, a benefactor of the Masterworks Museum of Bermuda Art, was pouring rum on the roof in a traditional regional "roof-wetting" ceremony Monday but managed to steady himself.

Fucking Michael Douglas. When presented with the opportunity, the guy adamantly refuses to fall on his head.

 

And on a completely different note, I've been considering making a dramatic overhaul to my sidebar. A few of the ideas I'm kicking around might not be compatible with my older blog skins. Does anyone use the Eat at The Fish's, Tossed My Salad, or Just For Charred skins? I'm thinking about getting rid of them to free my template for more radical designs, but I don't want to feel like I'm yanking the rug out from under too many people.

Speaking of design changes, I've changed the way this blog uses CSS. The "standard" methods for serving CSS are to have styles embedded in the HTML or to use static external files. I'm using a different method now. I'm serving CSS through PHP, which (among other benefits) allows some server-side trickery.

Anyway, you probably don't care about the behind-the-scenes voodoo. I bring it up only because I'm wondering about compatibility. I'd hate to go blazing forward with something that doesn't work for everyone. So if none of these new stylesheets are available to you, I'd really appreciate hearing about it.

Tuesday, November 14, 2006

And your thoughts?

I'm something of a stat junkie. I've got to check in on things at least once a day to see who's linking to me, where my visitors are coming from, and what kind of search engine terms people are using to find me. Last night I checked in and found a hit that was a little unsettling. Someone would up here in a search for child pornography. Well, probably. The search term was "kid sex blog."

First, doesn't it strike you as really stupid to use a search engine to look for kiddie porn?

Second, do we as bloggers have a responsibility to report hits like these? I saved all the info I have about this visitor. I'm not sure if I should do anything with it.

Sunday, November 12, 2006

Is it just me…

…or is anyone else enough of a code geek to see a resemblance between the anonymous skateboarding guy from the library of default Windows XP user avatars…

Anonymous Windows XP skateboarder guy

…and web standards guru Jeffrey Zeldman?

Jeffrey Zeldman on the cover of "Designing with Web Standards"

Anyone?

No?

Just me?

Thursday, November 2, 2006

WTF?

So I've got this super spiffy plugin Search Meter, right? Search Meter keeps totals of the queries people make using the built-in WordPress search feature. Results are tallied over a rolling thirty day period, so I don't have "all-time results," but I always know what people are looking for now.

The top search for the last thirty days? Chocolate cheese. What the hell? I totally don't understand how seemingly so many people can be interested in that. With 54 searches in the past month, there have been more searches for chocolate cheese than for the next four searches combined. (If you're curious, the next four are "none" with 19 [I really don't get that one], "grr" with 14, "debra" with 13, and "Radiohead" with 7 [fuckers].)

So what's up? Is this "the will of the people?" Are you trying to tell me to make this an all chococheese, all the time blog?

Saturday, October 21, 2006

D'oh!

For the last several years my anti-virus package of choice has been Norton AntiVirus. I've used it on my own computers and I've recommended it to anyone who's asked. I've always liked the way it works and how effective it's been.

But most of that has changed. Each successive package gets progressively larger and slower without introducing any appreciable new features. My recommendations have lately included more and more conditions. "It's not for you if your computer doesn't have this, or if you need such and such a feature, or if you use that one ISP."

Yeah, to hell with that. I'm done with Norton. I've even gone so far as to yank it out of my own computer in favor of the freeware AVG.

Norton, like nearly every other Windows program, leaves behind lots of little things when you uninstall. So after running the regular built-in uninstall routine I ran the special Norton removal tool from Symantec. There were still some traces left over, so I deleted those manually. I rebooted and went on my merry way.

A few hours later I noticed that one of my other programs, Forte Agent, seemed to have lost its icon. I investigated and saw that it wasn't just the icon missing, but the whole damn program folder. And not just that program. My Program Files folder was curiously missing everything up to the letter C.

I can only assume I accidentally deleted them when I was manually clearing out the Symantec junk. Agent, Adobe, Amaya, Ahead Nero… all gone. Fuck. I deleted at least a dozen programs. How the hell did I do that? That's going to be a mess to fix.

The next morning I was reading news over a bowl of cereal when I learned Microsoft had released Internet Explorer 7. Woo hoo! Finally! I'm a big believer in testing my web designs in as many browsers as possible, but I adamantly refuse to test compatibility in pre-release software. I've been burned before by beta packages that don't easily upgrade to their final release counterparts, so I've been impatiently waiting for the final release of IE 7.0.

I scurried over to Microsoft's web site to grab the download, and then very quickly learned that it wouldn't install for me. I'm one of those filthy Windows pirates, and the IE 7 installer includes a validation check. Bitches.

So off I went to scour the dark corners of the internet looking for workarounds. After a few false starts, I found what I needed. I snagged a custom package that used a patched version of the Beta 2 installer to install the files from the final version. Cackling with glee, I installed and rebooted my office computer (I was at work by this point in the day).

As Windows restarted, I was greeted with this happy little message:

Fake Microsoft error message

Nice. I broke my fucking workstation. I'm a tool.

After a little investigation and a little voodoo I was back to the point where I could at least access Windows Explorer again. I retraced my steps and found the error to be a pebcak. Apparently I don't know how to read the fucking instructions.

  1. Extract archive.

  2. Run update.exe.

  3. Do not reboot.

  4. Install other packages #1, #2 and #3.

  5. Now reboot.

That whole "do not reboot" thing? Those instructions must be for someone else. Surely not for an Advanced User like me. Yeah, I probably deserved my digital punch to the junk for that. In any case, I got it sorted out and was able to reinstall properly.

Then when I got home I repeated exactly the process on my home PC, including the part about not following the directions. I guess I wanted to… I don't know, confirm the error or something? Yup, sure enough, it broke my home computer too. At least on the 2nd go around I knew how to fix it and recovered very quickly. But still, what the hell was I thinking?

Don't trust me with anything technical for a while. I might be jinxed, maybe even cursed. You probably shouldn't stand too close to me either. I can't guarantee your safety.

Tuesday, October 17, 2006

Yay, new stuff!

I like new stuff. New stuff is good.

  1. New WordPress plugin: Comment Instant Messenger Links. Registered users can now add their AIM and Yahoo! Messenger ids to their profile and those ids will be attached to their comments and will be visible to other registered users. The plugin is available for anyone to download. If you decide to use it on your own blog, I'd appreciate your feedback.

  2. New gravatar option. Have you noticed that gravatars have been unreliable lately? The servers at gravatar.com have been dreadfully slow. When retrieving images, it's not uncommon for the gravatar servers to time out, return an error or return a blank image. On this blog I use a caching system that alleviates that somewhat, but I'm not completely insulated from the problems at gravatar.com.

    If you'd like, you can specify a "local gravatar," which I suppose would be technically just an avatar. For registered users, there's a Gravatar tab in your profile. You can use that tab to specify an avatar that will be used only on this blog. The interface doesn't include an upload, so you must provide the url to the location of an existing image. Supported are GIF, JPG, and PNG. Transparency and animation are also supported. If you make use of this feature, please make your image 50×50.

  3. I was going to make use of this space to pimp a new renter. I opened for bids yesterday and was planning on choosing a new renter this morning. And now Blog Explosion is down. I can't access their site to accept a bid. Bitches.

    Blog Explosion finally came back up and I've now got a new renter.

Thursday, October 5, 2006

I see how you are

The Richard Donner Cut

I'm so disappointed in you. I thought you people were my friends. I thought you had my back. Now I see the truth. Now I see how you are.

There's an extended version of Superman II on the way, and no one told me?! You know what an extended version means, right? More Richard Donner, more Christopher Reeve, more Marlon Brando and, most importantly, more General Zod.

I must own this DVD. I must. Zod requires it.

But anyway, back to you. Recently I've noticed people not using the nifty edit comment feature and instead leaving second comments to correct their mistakes. I thought, "What's the deal with that? Aren't people seeing the edit link? Maybe it's too subtle."

It wasn't too subtle. Well, maybe it was too subtle and some people didn't notice it. The problem was that it was broken. Doh! As an administrator, I don't see the same things readers see, so I never noticed.

Anyway, now my little code typo is fixed and the edit link is more obvious. But I'm still an administrator, so I still don't see it. I'm counting on you to let me know if it doesn't look or work right. Don't let me down. Again.

Friday, September 29, 2006

Don't I just suck?

Off and on for the last week or so I've been working on a technical how-to post. It's about using conditional CSS to improve the display of hyperlinks. It's well-written, informative and completely fucking boring. You know it's got to be boring if even I can't stand it. It's not really even that useful, it's just something that struck me a week ago.

Yeah, not so striking anymore.

 

The thing that inspired me to write the whole thing in the first place is that I wanted a solution to differentiate between my own internal links and links to some other site. I had this worked out and implemented in the crumbs blogskin. And it stayed there for about two hours before I got bored with it and killed it again.

If you're using Internet Explorer, you would never have seen it anyway.

 

The absolute worst thing about being a celebrity has got to be losing all the people you can trust to tell you the truth. Do you think celebs ever realize that one by one their real friends have vanished and they're surrounded by toadying yesmen? (Not that they're all men, but "yespersons" sounds fucking stupid.)

Example: Lindsay Lohan. She used to be absolutely adorable. She was one of those rare women who managed to pull off sexy and innocent simultaneously.

Old Lindsay

Somewhere along the line she found her inner skank. Over the past year or two she's turned so nasty celebrity gossip sites have taken to calling her "Firecrotch." Not just one or two gossip sites, but pretty much all of them. That's her rep. That's her image these days.

Firecrotch

I'm pretty sure that wouldn't have happened if she still had one true friend.