Monthly Archives: June 2012

How to export a data file from a WordPress plugin

As part of my hacking on WordPrss, I got to a point where I wanted to let folks import and export OPML files.
Exporting a file from a WordPress plugin doesn’t seem to be very well documented. I found an older article about it – here’s my take.

Provide a link to the file export

Export the data

This file isn’t getting included in through the normal wordpress mechanisms, so it has to do some more work than the rest of your plugin does. If you want to use the $wpdb or other handy wordpress items, you have to include those in.
I was about to hack up a way to include wp-config.php or wp-load.php when I ran across the simply named Don’t Include WP-Load, Please. He recommends a clever way to handle it all within wordpress, which I quite like. See below.

Now you can build out your export file – in this case export_opml.php – knowing that all of the WordPress utilities are there for you to use.

How to migrate your WordPress Blog between hosts.

My boss Mike needed to move his wine review blog from a friend’s hosting on lunarpages. I suggested he try dreamhost and he liked it – in a few minutes he had signed up for a free trial and used their 1-click install to set up a new install of wordpress.

Before he moved his domain to point from lunarpages to dreamhost I got him to prep by writing down a few important pieces of info. I’m trying to make sure I make this easier for other friends like I did when I helped Tove’s Thread For Thought move from WordPress.org to her own host.

Things to do before you change your domain to point to your new hosting

      Write down the name of your THEME. If you want to use the same theme, it’s important to write this down before you make the switch.
      Export your blog content from wordpress.
      Download your images. The wordpress export guide pretends this is easy, but it isn’t. If you are using the same domain name, I’m not sure what the easy way to do this is.

How to download your images

I wrote a python script that does this for you.
Make sure your system supports python. Next install BeautifulSoup – a great html parser for python.
Once that’s done, download this little script and change home and filesUrl to be your domain name.
Run the script, it should crawl your domain and download all of the images you host. Now follow the same steps of editing your export if needed and upload it all into your new blog at your new domain.

Hope that helps!

Darrick’s Geothermal Adventure

Darrick is a buddy from up in Rochester. He’s doing something which is the heart and soul of blogging. He’s taking a minor adventure from his life, and chronicling it for the people who care:

I’d like to take a week or two to blog about our experience with researching, and deciding to go with geothermal, and show the process of installing the system. I’ll be posting the numbers that I came up with which showed why geothermal made sense in our case.

There’s two kinds of folks who care – there’s me and the rest of his friends. We want to know what’s happening in Darrick’s life. We care what Darrick is doing because he is our buddy and we bond with people by knowing and talking about our lives. That’s the ambient communication that bonds people over time, and something the internet is good at enabling for folks who don’t live in close proximity anymore.

The other audience is people who are looking for info on geothermal. Darrick talks about how he chose a contractor for his project and how he calculated the payback on geothermal. Darrick’s way of breaking down the numbers is very useful.

According to all of the estimates our calculated payback time was about 5-7 years, with an annual savings of about 60-70% our existing heating cost. This was assuming that heating oil prices continued to rise, the heat load calculations were accurate, electricity prices continued to increase at the historical rate, and the historical weather patterns continued. These calculations assumed that I was replacing an existing heating system, which I wasn’t. None of the calculations used the cost of borrowing the money, and the cost of repairing the lawn after the job was completed. After adding in these additional factors, and removing the replacement cost of existing heater I came up with a more accurate payback time of about 9-10 years. This was still a worthwhile payback as we were planning on living in this house for at least 20 years. After 25 years it was estimated we will have saved about $100k (assuming oil prices continue to rise). Considering these savings, and the addition of air conditioning to our house, geothermal seemed like a great investment!

Here is giving other people the factors he considered and the way he justified the decision. That’s useful and it’s good for people who he might never even meet. This is the great sort of thing that delicious revealed back when it first started. Lots of people aggregating things just for themselves produces a resource that is greater than the sum of its tiny little parts. Like a nation, or a blogosphere, or a person, or a mind…

JME is trying Veganism

She’s been vegetarian for a long time, but is trying veganism as a sort of cleanse. Sure, she thinks her body is revolting, but I think it’s just the light. Sorry, can’t resist a groucho marx bit!

She’s also giving up booze for a bit. I can understand doing that as well.

I like to play with these same things. When I originally gave up meat, I did it because Sam and I had overdone it so much on a trip to Las Vegas that we couldn’t look at flesh without feeling ill. We discovered that if you stayed away long enough, you didn’t miss it. Anything that you think you crave, that consumes you – that’s a thing you want to be careful around. When I’ve found myself constantly out drinking with folks and having a wonderful time, that’s when I eventually want to pull back and show myself that I can have a great time without all that.

I think we all move in waves of moderation and indulgence and asceticism to some degree. It’s healthy to pour yourself into joyous pleasure. It’s also healthy to take a break, to pull back and realign yourself. Recalibrate. Give the old machine you ride in a bit of a cleanup and workover.

The saddest part of her excellent post:

Unless you can explain that you have a problem (and they’ll probably try and talk you out of that as well) if your friends drink, they will be highly disturbed by this decision. Just telling them I wanted to clean myself (read: liver) out a bit and get into shape brought on looks of ridicule. My partner has absolutely no problem quaffing beer while I drink sparkling water or unsweetened Iced tea but others will not even hang out with me one-on-one if I’m not drinking and they are. I think that’s sad.

If you find yourself being this person – it’s a good time to take a look at why you need someone else to take a drink.