Need More Guest Poems (and animations)!

Now that the poetry cycles up there in the header (except on Internet Explorer), people are likely to see a lot more of them on each visit. Sure, there’s well over a hundred in the rotation, but as every american knows, more is better. You can help! Send me yout little poems either here in the comments or by email, along with the name you want to appear with it. If you want your picture next to it, of course you have to supply that too. Otherwise I might just pick something. I have a couple of poems in the roatation —notably the ‘theme haiku’ — but mainly that little area is a place for guests to play.

And who knows? We know that great literary movers and shakers frequent this site. This could be your shot at the glamorous life of a poet!

Edited to add: Heck, why stop at poetry? You may have noticed the occasional duck flying through the header every minute or two. The way that’s done, I can load and play pretty much anything anyone out there puts together. It shouldn’t be too intrusive, of course, but with one simple tweak to your animation I can put it in the random list. Whether you’ve been thinking about learning a little Flash or you kick Flash’s ass, here’s a great chance to strut your stuff.

What could POSSIBLY be cooler than that? Nothing, that’s what!

Bar 300

I set out today to scout a place called Jazz Dock, a venue recommended by one of our musicians as a spot we could film the concert at a respectable hour. Let’s face it, one of the themes of the movie is the difference between the day world and the night world, and we are planning to simulate the night world during the day. The reason: the best places to film have actual concerts at night.

Jazz Dock is a new place, and is therefore not totally booked up. It is also completely, 100% wrong for our film. Oh, well. So there I was in Smichov, hanging with the guy doing the original music for the final scene. “Want to have a beer somewhere?” he asked.

He’s opening a sound studio around the corner from here soon, so he’s a bit familiar with the local drinkeries. His recommendation: Jungle Bar. As we walked it occurred to me that this would be bar 300 on my list.

Only, Jungle Bar was closed, and missed its chance at immortality. Bar 300 is instead Ragtime Bar, which is connected to Jungle Bar but had the advantage of being open. And here I sit. It’s a nice place.

Nice, but I can’t come up with much more to say about it. There’s lots of wood, which is good, a moderate amount of kitsch but not enough to bother me, decent music (not ragtime) playing, but somehow all of that leaves something missing. This despite the fact that we’re by the river and I had a great view across to the other side as the sun set and lit up the buildings. Meanwhile, a bunch of older guys who made me think ‘mafia’ were meeting here. What’s not to like?

Honestly, I have no idea. When you look at any individual facet of the place it comes across well, but in this case the whole is less than the sum of the parts. I think it comes down to a feeling that the place is calculated. It’s like a really well-executed chain restaurant. I’m not entirely sure what a place can to about that, except to allow the customers to leave an imprint on the place, to provide a little funkiness and family vibe. But pragmatically speaking, how do you bring that about?

Of course there’s always rock-stacking. There’s a way to set your bar apart: a stack pit, a web cam, exotic stones from around the world — some rounded, some angular. When the bar opens the stacks from the night before (if still standing) are knocked down with a toast to gravity. That would be the best bar ever.

2

Pardon the Dust

Although this is now the official home of Muddled Ramblings and Half-baked ideas, there’s still a lot of construction work going on. Some parts aren’t finished yet, and others, well, they’re just a bit on the ugly side. Obviously I’m not going to win any design awards, but that doesn’t bother me much.

Don’t let the construction deter you, though! Look around, and let me know what you think!

Today: Modified the Site Meter widget to show the MOH and next big number.

Let’s Make this Move Official

I just went back through and re-imported the entire old blog for what I hope is the last time. Before I did that, I had to delete all the episodes I’d imported before (I’ve made a few spelling corrections in the text, and the links did not reflect the impending redefinition of muddledramblings.com)

As I was deleting all the old stuff, I kept telling myself, “Don’t delete the episode with all the useful user feedback. Don’t delete the episode with all the useful user feedback.” Then Sparta scored a goal, flipping the puck through the five-hole, and Franta was saying, “Džer

Signatures

When I got my new credit card, I was admonished to sign the back right away. This strikes me as a fairly silly security measure — I wonder if that signature also somehow cements an agreement between me and the card issuer. But that’s for another day.

So here I was faced with a slick piece of plastic with a very small area to sign. There are no do-overs. If I choose the wrong pen and it doesn’t work out, that’s too bad. The biggest problem is the space available, however.

When I sign my name, the result cannot in any way be interpreted as a collection of letters, let alone one that spells a meaningful word. It is much more akin to the silly symbol Prince chose to represent himself with, except mine’s a mess. Whenever I sign something I start with every intention of maybe making the signature a little more legible this time, but then something in my cerebellum takes over and my hand begins to jerk spasmodically, working it’s way more or less left-to-right, then whipping around to finish with a flourish, a loop that goes all the way back to the beginning of the signature and slashes through it. This is not the sort of signature that fits on the back of a credit card.

What is it that takes over when I’m signing my name and causes me to create this scribble instead? It’s somewhat different when I sign ‘Jerry’ instead of ‘Gerald’, looser and often in two separable parts — with two big flourishes. Now that I think about it, it’s probably the ‘y’ in ‘Jerry’ that has survived enough to provide a break in the progress of the pen. I do seem to like those grand gestures.

Face with my card-signing task I tested pens and did some practice signatures, trying to write small enough. Finally I was ready, had a soft-tip pen with permanent ink, took a breath and started. Easy, easy… jerk. Once more my reptillian signature-writing brain took over, sending the pen out of the white space to get hung up in the numbers. There is no stopping now, though, and the next jerk brought me up into the designated zone again, somewhat off-course but still on the move. Loop! Twist! and at last the grand finale, which swooped the length of the white strip, rising with a bit of a tail on the end, obscuring the secret code number.

Overall, one of my better efforts.

1

Solvent!

Well, here I sit at Bowle & Bowling, listening to the rumble and clatter of the bowling balls, and a feeling of normalcy is starting to come over me. I can pay rent.

Even the last chapter of my adventure was not as straightforward as I had hoped. The credit card people told me, “you can get cash from any bank with a Visa sign on the door.” This, it turns out, is not true. Not at all. Not even close. What she should have said was, “It’s possible there’s a bank in Prague that will advance you cash on your card, but good luck finding it.”

I started my two-day quest in my own neighborhood, at the largest and fanciest bank. As usual in my neighborhood no english was spoken there, but we communicated surprisingly well. “I need money,” I said in Czech. I didn’t know how to say “cash advance” in Czech, and credit cards are so rarely used here that it wouldn’t surprise me if the bank lady didn’t know the word either. “You can’t use the bankomat?” she asked. “No, it’s an emergency card,” I explained. She thought for a moment. “I’m sorry,” she said. “I can’t help you. I don’t think any bank can.”

I canvassed the rest of the neighborhood and got the same story. It was getting late so I decided to try another approach. I would call my bank and see if they could issue me a PIN so I could restore all the happy ATM-ness to my card.

Naturally, that turned out to be complicated. Then my Internet connection went down, leaving me Skype-less.

Back on the street again today, an earlier start, knowing that I was going to have to go down to the city center to have any hope of success, and I would probably have to visit a currency exchange. There are plenty of them on Wenceslas square and thereabouts. I wandered up and down the street, window shopping. I noticed that the rates most places advertised were for very large amounts; the normal-human rate was much worse. Luckily (an odd sort of luck, I must say), I will be needing a lot of money, so I found the best rate at a 0% commission place and went on in.

After a little confusion because I said “hundred” instead of “ten” we got the deal squared away. “There will be a commission,” the woman said.

I thought of saying things like, “but your sign says…” but I knew it wouldn’t help, and I knew it would be the same everywhere. No commission on currency exchanges. Credit card: get ready to bend over. If asked they would probably say that they have added expenses and whatnot, and there’s a risk of fraud they have to factor in. In reality, it’s because people getting cash off their credits cards are all desperate schmucks like me. I was tired. I just wanted to be finished with this whole mess. I bent over.

This is officially the last time I think about how much I just spent to get my own money.

Now, no more worries! Now I have money, enough for me to cover rent and some of the expenses of filming, and I have time to find another conduit for the rest. Back on my feet, baby!

1

The Waiting is the Hardest Part

Last Friday I finally got someone in the banking world to take up my cause. I really wish I’d got her name, because she was the kind of get-it-done person you want when you are hungry and all your money is tantalizingly beyond your reach. Hours later the call came from Visa: your replacement card is on the way!

Hooray!

She told me it would be delivered the next business day, Monday. I woke up this morning with the sun on my face (solved with a pillow), but then Real Life started to weasel into my thoughts and suddenly I sat up with a jerk and lunged for the computer. What day is it?

The answer: Monday (rhymes with today). I’m getting an express delivery today. I don’t know when.

I live in what is called around here a ‘villa’. It’s a big house built to have a family on each floor. My place is an afterthought; at some point someone realized that the attic was just a lost opportunity for rent. It takes me three keys to get in: There’s the iron gate by the street, then there’s the door to the building, then there’s my own door at the top of the steps. The catch is that someone on the street has no way to signal me to come down. As I type this, the delivery guy could be down there cursing my name.

So I sit now, windows cracked open despite the chill rain outside, waiting to hear the UPS guy. I am hopeful — when I talked to the final Visa operator I mentioned that the driver should have my phone number. “It will be in the information,” she said, “But we can’t guarantee that the driver will have a telephone.” That was the first funny thing that came out of this whole trauma. A czech without a phone. Ho!

But now I sit, my apartment getting colder (a little complicated – my only windows with ears to the street are in the bathroom, where my heater also lives. The heater pump is failing, and makes a racket. If I have the bathroom door open to hear sounds from the street, I can’t have the heater hammering away.)

So now, I wait. And hope. If the weather was nice I’d just take a book and a chair down to the front lawn. Alas, the weather is not nice. So I’m up here, afraid to do anything that makes the slightest sound lest I miss the critical delivery. Today promises to be big fun.

Rant of a Geek

So I destroyed the forum at Jer’s Software Hut. By pure blind luck—the purest and blindest variety of this luck: Extra Virgin Pure Blind Luck, I made a backup two minutes before destroying the forums. I have yet to restore the forums from the backup for reasons I’m not sure of, but the data is there, and I know I will be able to pull it off eventually.

So I have this file that should restore the database to its previous condition. Groovy. Only problem is, it doesn’t work. I’ll figure it out. But that’s not my beef here. My beef is about units. The maximum size for an uploaded restore file is 102 kKiB.

How big again?

There’s been a movement afoot to try to separate the binary “thousand” from the decimal thousand. Thus a thousand meters is a kilometer (km), and a 1026 bytes is no longer a kilobyte (kB), but a kibibyte (KiB). I’m down with that. It’s a distinction I already made in my head, and now it’s codified.

But then there’s 102 kKiB. No. No, no, no. You’re at three decimal point precision here, there’s really not any reason whatsoever to be mixing your numbering systems. (I’m cc’ing this message to the people at myPhPAdmin.) Why not just say 99 MiB? Every mainstream operating system reports file size in MiB (though they call it MB), so suddenly there’s no deciphering involved.

Maybe it’s just the residual physics geek in me, but units, properly used, make things simpler. I got out of a second semester of class by unit-analyzing my way through a test. I had no idea what the question was asking, but I knew what I had and I knew what units the answer had to be in, and most of the time that and a little calculus is enough.

But that has nothing to do with my current rant. My rant is this: 102 kKiB is really effing retarded.

I feel better now.

Edited to add: Apparently, the “MB” numbers on hard drives are the absolutely retarded 1000 x 1024 Bytes, or 1000 KiB, or 1 kKiB. Even though it’s stupid, I will swallow and not be annoyed when the unit is used in direct reference to a hard drive, for truth in advertising. In the case of a file upload, there is still no excuse.

Balaton

The cheapest (large) beer at Little Café Near Home is now well over a buck fifty. My preferred beer is nudging up against two dollars for half a liter. Therefore I’m spending more time at the Budvar bar next door. Tonight, however, I stopped by LCNH to snag a bottle of wine. Tea, bless her heart, a fine and happy soul who understands that life is but a joke, redirected my eye from the 95-crown wine selection to the hungarian outlier. Twenty crowns. Today, about ninety-five cents.

It’s sitting on the table in front of me as I write this. I’m a little bit afraid. I will open the bottle tonight. I will drink at least some of the contents. It’s just my imagination I know, but I already feel the hangover coming on. But for science, it must be done. Wish me luck.

1

Sailor Jerry Rum

Recently I was at a bar and I noticed a bottle on the shelf labeled “Sailor Jerry Rum.” I was intrigued, but it was not a rum-drinking time. It wasn’t a rum-drinking time yesterday at Press Café either, but fuego was there and I mentioned that I should have some before I left. Turns out Sailor Jerry is also found in the United States, but fuego decided that I may as well check off that to-do item anyway. We ordered a pair of small shots.

I’m not a rum drinker, but this stuff didn’t seem very good at all. Sweet. fuego dubbed it “girl rum,” though it was certainly not as bad as Captain Morgan. A pity, with such a noble and tasteful name, that the product didn’t live up to expectations.

3

Travelers Tip: Don’t Use Raffeisen Bank

I am still struggling to recover from having my bank card eaten by an ATM at the bank closest to my house. In fact, this is the second time it’s eaten my card, but the first time I had a backup. As my tale of woe spreads, I’ve learned that several of my friends have had their cards eaten by the hungry bankomat machines of Raffeisen.

My theory on the matter is that Raffeisen is more sensitive to fraud than other banks, so if the slightest thing goes wrong on the transaction (say there’s a glitch in transatlantic communication, or, as is the case with my bank, one of the card-processing networks that serves them goes down), that’s it – card eaten. For locals this is an inconovenience, for travelers it is a major pain in the butt.

So, while before I thought it was bad luck that my first card got eaten, now I know that there is a difference in banks, and I will never use a Raffeisen bankomat again. I encourage you to do the same.

Meanwhile the emergency delivery of a replacement card has been far less than swift. First told I could even have a card the next day, now it’s been a week and I’ve been riding a ridiculous merry-go-round between San Diego County Credit Union and Visa Emergency Services. My nerves got a bit frayed on the phone last night, as the credit union seemed to have gotten confused somewhere along the way about a check card I never activated and in fact don’t have. Sure wish I did. Or that I’d applied for a Paypal card. Or anything.

“I’m getting hungry,” I tell them over the phone. (Thank the gods of telecommunication for Skype.) Now I’m waiting while (once more) Visa Emergency Services seeks permission from my bank to issue a new card.

So, lessons learned: First, don’t use Raffeisen Bank. Never. Second, don’t don’t count on two organizations to work well together. Hound them relentlessly until things are fixed. Third, don’t tell your landlord you’ll have the money on a certain day. I never thought I’d be the one tip-toeing past the landlord’s door. That’s out of a sit-com, right? Except that was me today. And just like in a sit-com, I got to the bottom of he stairs, realized I’d forgotten something, and tip-toed back up and down again. High comedy.

1

A Day of Design

I had other things I needed to do today, and the new blog sucked up WAY too much of my time. I’m working on making the new banner actually look cool, rather than merely function. It’s going… OK, I guess. I’ve already spent a long time trying to figure out colors, when I think the core problem is that the fonts just plain don’t work well together. The guest poem system is mostly done, but I don’t have it displaying the author pictures yet. There’s a bit of a problem there; For most of the poems there’s plenty of room for a picture, but there are a few poems that need a lot of space. I’ll work something out.

I also worked on the comment popup window over there. It’s not great, but it’s a heck of a lot better than it was.

Overall, what do you think? Still to come: sound effects (and a mute button), and a way to play “All for me grog!” I might sneak in a couple of other surprises, too.

The Language of Omission

She was surprised when I mentioned that I knew she was sweet on the guy, but it would be pretty dang obvious to anyone who paid attention. I haven’t seen her in a few weeks since but she’s here now, sitting next to the man of her dreams, and he’s being friendly but is also being meticulously careful to not give the wrong idea. Case in point: she pulled out a cigarette, slipped it between her lips, and waited. No lighter came. That has to be a sad moment.

Geekery: Transferring this blog from iBlog 2 to WordPress

Note: For those looking to move from iBlog 2 to wordpress, this article and some follow-up can be found at the iBlog survivors’ forum. The complete script is available there for download. You really don’t have to understand all this stuff.

I started using iBlog several years ago, when it was new and I was new to blogging. It had one advantage over other blogging packages: it came free with my .mac account back in the day and it worked on .mac servers, which are, to put it kindly, inflexible.

Two things have happened in the intervening years: first, all the blogging platforms have gotten much better, including the ability to work on the blog while offline. The second is that iBlog made an abortive step forward to iBlog 2, which was a major improvement, but then the whole company stalled before that release was really finished (although by then I was fully committed to it). I will miss iBlog 2, but not as much as I will enjoy getting my stuff onto a faster, more versatile platform.

After a rather exhaustive search of blogging and CMS systems, I settled on WordPress. While it’s not perfect, it is a straightforward MySQL-Apache-php application that is easy to fiddle with, and some of the customizations I was looking for were much easier with WordPress than with others.

WordPress has a whole bunch of tools and instructions for importing your stuff from other blog systems. None of those did me much good at all, however, as iBlog was too obscure for anyone to worry about. After searching the Internet I found some helpful information, but it all applied to iBlog 1 – most people never made the move to the ill-fated upgrade. I was pretty much on my own.

WordPress can import data in a variety of formats, but it was up to me to get the data out of iBlog in a format WrodPress could understand. The most versatile format was one created by the folks at WordPress, which could include information specific to WordPress. Cool! Decision made, I was on my way.

Except… the folks at WordPress have never bothered to document the structure of their files. Apparently It’s something they’ve been meaning to get around to eventually (though the people writing translation software for the other major blogging software have long since muddled through it). I did what everyone else has had to do to export data: copy one of WordPress’s files and fiddle with it until it works. Not only is this a pain in the patoot, there might be tags that don’t appear in my examples that could nonetheless be useful to me. Oh, well.

I needed my import file to include definitions of categories, and then each of the blog entries, with correct category associations. My example file had a lot of fields that seemed redundant for my purposes, but without documentation I wasn’t going to waste time trying to figure out which tags were required and which weren’t.

Here is a very small (one episode) export file. We’ll go into the details of things like nicename later:

<rss>
<channel>
    <title>Muddled Ramblings and Half-Baked Ideas</title>
    <link>http://jerssoftwarehut.com/muddled</link>
    <description>blog!</description>
    <pubDate>Thu, 28 Jun 2007 21:32:21 +0000</pubDate>
    <generator>Jers Very Clever Script</generator>
    <language>en</language>
    <wp:wxr_version>1.0</wp:wxr_version>
    <wp:base_site_url>http://jerssoftwarehut.com/muddled</wp:base_site_url>
    <wp:base_blog_url>http://jerssoftwarehut.com/muddled</wp:base_blog_url>
 
<wp:category>
    <wp:category_nicename>bars-of-the-world-tour</wp:category_nicename>
    <wp:category_parent></wp:category_parent>
    <wp:posts_private>0</wp:posts_private>
    <wp:links_private>0</wp:links_private>
    <wp:cat_name><![CDATA[Bars of the World Tour]]></wp:cat_name>
    <wp:category_description><![CDATA[blah blah blah]]></wp:category_description>
</wp:category>
 
<item>
    <title>Delayed by Weather</title>
    <link></link>
    <pubDate>2007-03-27 18:23:57</pubDate>
    <dc:creator><![CDATA[Jerry]]></dc:creator>
    <category><![CDATA[Bars of the World Tour]]></category>
    <category domain="category" nicename="bars-of-the-world-tour"><![CDATA[Bars of the World Tour]]></category>
    <content:encoded><![CDATA[<p>The Weather Channel is calling the roads around here "a big mess", so I'm going to take time out from driving and catch up on some writing. Unfortunately, TWC is also calling for dangerous surf and "rough bar conditions". I'd better leave the laptop in my room.</p>]]></content:encoded>
    <excerpt:encoded><![CDATA[&amp;nbsp;]]></excerpt:encoded>
    <wp:post_id>1065</wp:post_id>
    <wp:post_date>2007-03-27 18:23:57</wp:post_date>
    <wp:post_date_gmt>2007-03-27 18:23:57</wp:post_date_gmt>
    <wp:comment_status>open</wp:comment_status>
    <wp:ping_status>open</wp:ping_status>
    <wp:post_name>Delayed by Weather</wp:post_name>
    <wp:status>publish</wp:status>
    <wp:post_parent>0</wp:post_parent>
    <wp:post_type>post</wp:post_type>
</item>
 
</channel>
</rss>

But how to create the file? The data for iBlog 2 is distributed over (literally) thousands of files. Writing a program to track down all the information and make sense of it would be a major chore. That’s where AppleScript came in. iBlog’s programmer took the time to provide access to the iBlog data through the Apple Scripting system. I was able to let iBlog read all of its silly scattered files and make sense of them, then provide the data to me in a coherent fashion. So far, so good. All I needed to do was loop through all the episodes, pull out the data I needed, and shovel it into a text file that WordPress could read.

[IMPORTANT NOTE: I’ve tried to go back and reconstruct the scripts as they were at the appropriate stage in development, but the snippets are untested.]

[ALSO IMPORTANT: you don’t really have to understand the code. If you are in this boat, I will help you. You should understand the challenges, but I’m here for you.]

on run

set exportFile to 0

try

set exportFile to open for access “Users:JerryTi:Documents:scripts:” & niceName & “.xml” with write permission

set eof of exportFile to 0

tell application “iBlog” to set cats to the categories of the first blog

repeat with cat in cats

tell application “iBlog” to set catname to (the name of cat) as text

set niceName to the first word of catname

write rssHead to exportFile as «class utf8» — xml/rss header stuff that’s always the same

set catDescription to “blah blah blah”

write out the category info

tell application “iBlog” to set nextText to “<wp:category>” & newLine & tab & “<wp:category_nicename>” & niceName & “</wp:category_nicename>” & newLine & tab & “<wp:category_parent></wp:category_parent>” & newLine & tab & “<wp:posts_private>0</wp:posts_private>” & newLine & tab & “<wp:links_private>0</wp:links_private>” & newLine & tab & “<wp:cat_name><![CDATA[” & catname & “]]></wp:cat_name>” & newLine & tab & “<wp:category_description><![CDATA[” & catDescription & “]]></wp:category_description>” & newLine & “</wp:category>” & newLine & newLine

write nextTex
t
to exportFile as «class utf8» — have to coerce the text from 16-bit unicode

tell application “iBlog” to set ents to the entries of cat

repeat with ent in ents

get the stuff in iBlog’s world, work with it here

tell application “iBlog”

set titl to (the title of ent)

set desc to (the summary of ent)

set bod to (the body of ent)

set postDate to the post date of ent

end tell

set nextText to (((“<item>” & newLine & tab & “<title>” & titl & “</title>” & newLine & tab & “<link></link>” & newLine & tab & “<pubDate>” & postDate) & “</pubDate>” & newLine & tab & “<dc:creator><![CDATA[Jerry]]></dc:creator>” & newLine & tab & “<category><![CDATA[” & the name of cat & “]]></category>” & newLine & tab & “<category domain=”category” nicename=”” & niceName & “”><![CDATA[” & the name of cat & “]]></category>” & newLine & tab & “<content:encoded><![CDATA[” & bod & “]]></content:encoded>” & newLine & tab & “<excerpt:encoded><![CDATA[” & desc & “]]></excerpt:encoded>” & newLine & tab & “<wp:post_id></wp:post_id>” & newLine & tab & “<wp:post_date>” & postDate) & “</wp:post_date>” & newLine & tab & “<wp:post_date_gmt>” & postDate) & “</wp:post_date_gmt>” & newLine & tab & “<wp:comment_status>open</wp:comment_status>” & newLine & tab & “<wp:ping_status>open</wp:ping_status>” & newLine & tab & “<wp:post_name>” & titl & “</wp:post_name>” & newLine & tab & “<wp:status>publish</wp:status>” & newLine & tab & “<wp:post_parent>0</wp:post_parent>” & newLine & tab & “<wp:post_type>post</wp:post_type>” & newLine & “</item>” & newLine & newLine

write nextText to exportFile as «class utf8»

end repeat

end repeat

write rssTail to exportFile as «class utf8» — xml/rss file closing stuff

on error errStr number errorNumber

if exportFile is not equal to 0 then

close access exportFile

set exportFile to 0

end if

error errStr number errorNumber

end try

if exportFile is not equal to 0 then

close access exportFile

set exportFile to 0

end if

end run

So far things are pretty simple. The script loops through the categories, and in each category it pulls out all the episodes. Only it kept stalling. It turns out that sometimes iBlog took so long to respond that the script gave up waiting. I added

with timeout of 600 seconds

at the start to make the script wait a full ten minutes for iBlog to respond. Yes, iBlog certainly is no jackrabbit of a program.

Now the program ran! The only problem is, the resulting file doesn’t work. Hm. The first thing the importer reports is that it can’t read the dates the way AppleScript formats them. So, I added a function to reformat all the dates to match the example. Then it was importing categories, but not items. Why not?

Um… actually I don’t remember the answer to that one. Let’s just say that it took a lot of fiddling and testing to get it right. Eventually, hurrah! There in my WordPress installation were episodes from iBlog.

And they looked like crap. The thing is, that iBlog included unnecessary HTML tags around the blog title, excerpt, and body. It’s going to be a lot easier to clean them up now, while we’re mucking with each bit of text anyway, so back to AppleScript’s lousy string functions we go to clean up iBlog’s mess. Now, after we get all the data from iBlog, we call a series of functions to clean it all up:

set titl to stripParagraphTags(titl)

set desc to stripParagraphTags(desc)

set postDate to formatDate(postDate)

set bod to fixBlogBodyText(bod, postDate)


The actual functions are available in the attached final script.

Things are looking better, but still not very good. Much of this is due to some junk iBlog did when converting my older episodes into iBlog 2 format. One thing it did was to insert hard line breaks in the text of the blog body. No idea why. Maybe they were there all along and I had no way to see them. WordPress helpfully assumes that if you have a line break in the data it imports, you want a line break when it shows on the screen. So, every line break is replaced by a <br /> tag when imported into WordPress. This will not do. Additionally, iBlog replaced paragraph breaks </p><p> with a pair of break tags: <br /><br />. Once again, the reason for this is a mystery. The latter issue is less important, but we may as well address it while the hood is up.

Back we go into the fixBlogBodyText function, to repair more silly iBlog formatting. The resulting function looks like this:

on fixBlogBodyText(s, postDate)

this assumes that if an episode is supposed to start with a div, it will have a style or class

if (the offset of “<div>” in s) is equal to 1 then

set s to text 6 thru (the (length of s) – 6) of s

in some cases there was an extra line feed at the end of the text as well

if the last character of s is “<” then

set s to text 1 thru (the (length of s) – 1) of s

end if

set s to “<p>” & s & “</p>”

end if

clean up iBlog junk (lots of this stuff is the result of upgrading to iBlog 2 – the conversion was not clean

replace all line breaks with spaces

set s to replaceAll(s, “

“, ” “)

replace all double-break tags with paragraph tags

set s to replaceAll(s, “<br /><br />”, “</p>” & newLine & “<p>”)

replace all old-fashioned double-break tags with paragraph tags

set s to replaceAll(s, “<br><br>”, “</p>” & newLine & “<p>”)

get rid of some pointless span class info


set s to replaceAll(s, ” class=”Apple-style-span””, “”)

return s

end fixBlogBodyText

note: replaceAll is a utility function I wrote that does pretty much what it says. You will find it in the attached source file. newLine is a variable I defined because left to it’s own devices AppleScript uses the obsolete Mac OS 9 line endings. What’s up with that?

At this point the text is importing mostly nicely. But wait! I was running my tests just working with one category to save time. When I looked at Allison in Anime on WordPress, some really weird things started happening. It turns out that when importing the data, you need line breaks every now and then, otherwise the importer will insert them. That would be nice to put in the documentation somewhere! In one of my episodes, the newline was inserted right in the middle of a <div> tag, which led to all kinds of trouble. So, to the above script I added a line that inserts a line break between </p><p> tags. As long as any one paragraph isn’t too long, I’ll be all right.

set s to replaceAll(s, “</p><p>”, “</p>” & newLine & “<p>”)

And with that, we’ve done it! We’ve written a script that will export all the data from iBlog 2 and format it in a way that WordPress can accept. Time to run it on the whole blog, go take a little break, and come back and see how things went…

Dang. Didn’t work. There’s a maximum file size for import, and my blog is too damn big. Not a huge problem, just a bit of modification to make each category a separate file. Now, at last, the data is imported, the text looks nice, and we’re ready to make the move to our new home.

Except…

The images don’t show up, and links between episodes are broken. Also, it would be nice if people could still read the old Haloscan comments. I guess we’re not done yet.

Image links were the easiest to repair. In iBlog 2 the source code always looks for the image at path /https://muddledramblings.com/wp-content/uploads/iblog/. We just have to find those links and replace them with new info. I used Automator to find all the image files in the iBlog data folders, then I copied them all up to a directory on the WordPress server, and pointed all the links there. Worked like a charm! (Icerabbit goes into more detail on that process here. I used different tools, but the process is the same.)

Links between episodes turned out to be a lot trickier. It came down to this: How do I know what the URL of the episode is going to be when I load it into WordPress? I had to either know what the episode’s id was going to be, or I had to know what its nicename was going to be.

Nicename is a modified title that can be used in URL’s – no spaces and whatnot. “Rumblings from the Secret Labs” becomes “rumblings-from-the-secret-labs”. If I set up wordpress to use the nicename to link to an episode rather than the ID number, it would have some advantages, but I can get long-winded (have you noticed?) and that applies to my episode titles as well. The URL’s for my episodes could get really long. Therefore, I’d rather use the episode’s ID for its permalink. (If you try the icerabbit link above, you will see the nicename version of a link.)

Happily, the import file format allows me to specify the id of episodes I upload. (I don’t know what it does if there’s already an episode with that ID.) After some fiddling I managed to specify reliably what ID to give each episode. Now in my script I make a big table with the iBlog paths to each episode and the ID I will assign it. Before the main loop I have another that builds the table:

first loop

set postID to firstPostID

set idTableRef to a reference to episodeIDTable

tell application “iBlog” to set cats to the categories of the first blog

repeat with cat in cats

set cat to item 1 of cats

tell application “iBlog” to set catFolderName to the folder name of cat

display dialog catFolderName

copy {catFolderName, -1} to the end of idTableRef

tell application “iBlog” to set ents to the entries of cat

repeat with ent in ents

tell application “iBlog” to set episodeFolderName to the folder name of ent

set episodePath to catFolderName & “/” & episodeFolderName

copy {episodePath, postID} to the end of idTableRef

set postID to postID + 1

end repeat

end repeat


Now it’s possible to look up the id of any episode, and build the new link. The lookup code is in the attached script, and also handles the special cases of linking to a category page and to the main page. For category pages, I just hand-built a table of the category ID’s I needed based on previous import tests.

Finally, there is the task of preserving the links to the old comment system. Happily, those Haloscan comments are also connected based on the file path of the episode. (Though it looks like really old comments are not accessible, anyway, which is a bummer.)

In the main loop, after the body text has been cleaned up, tack the link to Haloscan on the end, complete with hooks to allow CSS formatting:

set bod to bod & newLine & newLine & “<div class=”jsOldCommentBlock”><span>Legacy Comment System:</span> <a href=”javascript:HaloScan(‘” & entFolder & “‘);”><script type=”text/javascript”>postCount(‘” & entFolder & “‘); </script></a></div>”

Not mentioned above are functions for logging errors and a few other utililties that are in the main script file. They should be pretty obvious. The script includes code that is specific to issues I encountered, but it should be a good start for anyone who wants to export iBlog 2 data for import into another system. It SHOULD be safe to execute on your iBlog data; it doesn’t change anything on the iBlog side of things. I don’t know if there’s anyone else in the world even using iBlog 2 anymore, but if you would like help with this script, let me know.

Is the Hut running?

Hey, can someone test these links for me?

From where I’m sitting right now, I can’t access Jer’s Software Hut or the blog construction site. I can reach everything else on the Web, so I’m wondering if my server is down or if my IP address has been blocked by my host’s security robots (again). I went to sleep with an open connection to my WordPress database and that might have triggered something. Can anyone out there load those pages and let me know? Thanks!