To move your blog posts someplace else you first need to get them off of Yahoo 360. If you only have a few you can edit the posts and then copy and paste them into your new blog. If you have a bunch that may prove to be impractical. I'm going to tell you how I converted my blog posts to a Movable type import file which can be imported by many different types of blog software.
First thing is you need linux. Find out the permanent URL of your last blog posting and record it somewhere, then make a new directory and copy the following script into the directory. Name the script whatever you want but remember to set the execute bit, in my case I called it get.
Code
#!/bin/sh | |
# call as get "last blog post url" | |
wget "$1 " | |
i=$(echo "$1" | sed -n -e 's|http://*.360.yahoo.com/\(.*\)$|\1|p') | |
echo $i | |
while [ -n $i ] ; do | |
n=$(sed -n -e 's|<span>Previous Post: <a href="\(.*\)">.*$|\1|p' $i) | |
echo $n | |
wget $n | |
i=$(echo $n | sed -n -e 's|http.*\(blog.*\)|\1|p') | |
while [ ! -e $i ] ; do | |
wget $n | |
i=$(echo $n | sed -n -e 's|http.*\(blog.*\)|\1|p') | |
done | |
done |
When the script finishes you will have all your blog postings saved as HTML files in the directory you ran it from with names the same as the url minus the http and the domain, the posting shown as an example will become blog-hwLjH.Myfxxxx8RH6xCteD6OzzzzzrB?p=287.
Then I wrote this little program to take the output files and convert them to Movable Type format.
Code
#include <fstream> | |
#include <iostream> | |
#include <iomanip> | |
#include <sstream> | |
#include <string> | |
#include <cctype> | |
| |
using namespace std; | |
| |
int main(int argc,char *argv[]) | |
{ | |
cout << argv[1] << endl; | |
ifstream in; | |
ofstream out; | |
string iname = argv[1]; | |
string ofilename; | |
size_t found_begin, found_end; | |
found_begin = iname.find("p="); | |
ofilename="blog"; | |
ofilename+=iname.substr(found_begin+2); | |
ofilename+=".txt"; | |
cout << ofilename << endl; | |
in.open(argv[1]); | |
out.open(ofilename.c_str()); | |
stringstream data; | |
string d; | |
bool titlef = false; | |
bool bodyf = false; | |
bool datef = false; | |
string title; | |
string body; | |
string hold; | |
string date; | |
string tag; | |
struct tm ttt; | |
if (!in.good() ) cout << "Couldn't open file" << endl; | |
out <<"AUTHOR: Wayne" << endl ; | |
while ( in.good() && !(titlef && bodyf && datef)) | |
{ | |
getline(in,d); | |
if (!titlef) | |
{ | |
found_begin = d.find("<dt class=\"post-head\">"); | |
if (found_begin!=string::npos) | |
{ | |
found_end= d.find("</dt>"); | |
if (found_end!=string::npos) | |
{ | |
title = d.substr(found_begin+22,found_end-found_begin-22); | |
cout <<"TITLE: " << title << endl ; | |
out <<"TITLE: " << title << endl << "STATUS: Publish" << endl << "ALLOW COMMENTS: 1"<<endl; | |
titlef = true; | |
} | |
} | |
} | |
if (!bodyf) | |
{ | |
found_begin = d.find("<div class=\"content-wrapper\">"); | |
if (found_begin!=string::npos) | |
{ | |
getline(in,d); | |
found_end= d.find("<div class=\"foot\">"); | |
while ( in.good() && (found_end==string::npos)) | |
{ | |
hold=hold+d; | |
getline(in,d); | |
found_end= d.find("<div class=\"foot\">"); | |
} | |
body = hold.substr(0,hold.length()-6); | |
cout << "-----" << endl << "BODY: " << endl << body << "-----" << endl ; | |
bodyf = true; | |
} | |
} | |
found_begin=d.find("\"?tag="); | |
if (found_begin!=string::npos) | |
{ | |
found_end=d.find("rel",found_begin)-2; | |
tag="CATEGORY: " + d.substr(found_begin+6,found_end-found_begin-6); | |
out << tag << endl; | |
cout << tag << endl; | |
found_begin=d.find("\"?tag=",found_end); | |
while (found_begin!=string::npos) | |
{ | |
found_end=d.find("rel",found_begin)-2; | |
tag=","; | |
tag="CATEGORY: " + d.substr(found_begin+6,found_end-found_begin-6); | |
out << tag << endl; | |
cout << tag << endl; | |
found_begin=d.find("\"?tag=",found_end); | |
} | |
} | |
if (!datef) | |
{ | |
found_end = d.find("(EDT)"); //change this to match the time zone of your articles | |
if (found_end==string::npos) found_end = d.find("(EST)");//change this to match the time zone of your articles | |
if (found_end!=string::npos) | |
{ | |
found_begin= d.find("<p>"); | |
if (found_begin!=string::npos) | |
{ | |
date = d.substr(found_begin+3,found_end-found_begin-3); | |
datef = true; | |
strptime(date.c_str(),"%a %b %d, %Y - %r", &ttt); | |
char datec[100]; | |
strftime(datec,99,"%m/%d/%Y %R:00",&ttt); | |
date = datec; | |
cout <<"DATE: " << date << endl ; | |
out <<"DATE: " << date << endl ; | |
out << "-----" << endl << "BODY: " << endl << body << endl <<"--------" << endl ; | |
} | |
} | |
} | |
| |
} | |
out.close(); | |
in.close(); | |
} |
Compile and run this code passing the name of the file you want to convert. You can take the files from the previous step and put them into one file with the command
cat blog* >> postings
If you call the program parse the command would be
./parse postings
You can then take the resulting .txt file and import it using the Movable Type import tool of your choice. This file has only been tested on b2evolution and if it doesn't work you have the source, fix it yourself.
Kudos to CBC for offering a streaming version of their new show jPod on their website. Unfortunately the code to launch the viewer doesn't work on Firefox version 1.5 on Centos 5. This piece of convoluted code,
javascript:Nodes.pauseAll();Jpod.toggleAudio("off");
myLightWindow.activateWindow({href:"http://www.cbc.ca
/jpod/videoPlayer.html?maven_playerId=jpodplayer", title:"", type:"external", params: "lightwindow_width=740,lightwindow_height=460"});
which does nothing, can be replaced with http://www.cbc.ca/jpod/videoPlayer.html?maven_playerId=jpodplayer which works fine.
Check out the show and tell me what you think.
updated April 19th 2009 with a link to the conversion article
updated April 20th 2009 fixed an error in the link to the conversion article
After being jerked around by Yahoo 360 I have finally bit the bullet and moved my blog away from that sinking ship. After a cursory inspection of the blogs available I picked b2evolution as the blogging software to install. It seems to be working out OK so far. I used a script to screen scrape my blog from Yahoo 360 and then wrote a little conversion program to take the saved HTML files and convert them to the Movable Type import format which b2evolution can handle. I've written a separate post on the conversion process for any other Yahoo 360 refugees who want to move their old blogs. If you aren't the DIY type, I was toying with the idea of offering to do the conversion for $20. Another option for 360 refugees is Multiply.com which has an import feature for Yahoo 360 blogs.
While Googling for information about Yahoo 360 problems I came across the news that Yahoo announced back in October that they were going to shut down 360. What they actually said was
"we intend to transition Yahoo! 360 to a more integrated Yahoo! experience in early 2008."
Thanks for communicating this to your users Yahoo. In the interim they aren't fixing any bugs which explains why I'm having so much trouble posting and editing articles. My plan is to transition my blog to a more reliable user experience very, very soon. I'm not prepared to put up with another buggy product that never makes it out of beta. I remember the debacle that was Yahoo TV when it transitioned to a more integrated Yahoo experience. That's why I use epguides.com and Canada.com now.
Another blog posting bites the dust. It's late, I'm tired and I didn't copy the text before I hit post so this is the second time I'm writing this post. The router from hell had hung at the office yet again. I noticed it today when I was trying to connect to do some work. Enough being enough I stopped at Canada Computers to buy a new router. While there I looked longingly at the Asus eee PC. They are so cute, I'd buy one but I read that they are coming out with new models this spring. I don't really need it but it seems like such a neat gadget. Trying to get past the 8 GB storage limit is one hurdle, especially when for $100 more I can get a regular laptop. I'd also like to try one before I spend the money to see if an internet appliance will meet my desires.
I was over at my brother's tonight for dinner and we were talking about the 11 communion settings in our church's new service book. We decided there needed to be a poll to determine which was the most popular setting. I'll set it up on my website tomorrow.
The first time I wrote this post I commented on how I should write down my ideas because I can never remember them when it comes time to write. While rewriting this post I realized that I couldn't remember much of what I wrote the first time.
Over the last weeks I watched as they demolished Southbrook farms. The house, the barn, the building where they had their farm store. All that is left is a pile of rubble which will soon be replaced with a high school and more houses. I remember going into the winery store that was in the bottom part of the barn to pick up some wine. There was a fire burning in the wood stove and it was very pleasant and homey. Later on they moved the wine store into the farm store building and it wasn't the same.