01/24/08

  05:14:01 am by wdawe, Categories: uncategorized, whine

sleeping on the napsack
Monday afternoon my wife called me at work to tell me our dog was not her characteristic happy self but instead lackadazical and droopy. This usually happens when she has eaten something. Her nickname is Garbage Hound because she is alway snuffling around trying to find something we have dropped. The suspicion was that she had eaten a part of a Poinsettia leaf because a my youngest son had found one that was wet and only half there on the floor. Princess has already had one trip to the late night vet clinic when she got into some chocolate last Christmas. After some internet research we were reassured that Poinsettia leaves are not acutely toxic but have an irritating sap that cause intestinal upset. The symptoms are drooling, vomiting and diarrhea. She had been drooling already and by the time I made it home she had thrown up on the carpet which seemed to make her feel better. Luckily we were spared the diarrhea and the next morning she was back to normal. When discussing my dog eats stuff story with the bartender at my Tuesday night haunt she told me that her seven pound Yorkie had eaten a whole large Toblerone bar at Christmas with no ill effects.

Tonight I went to our local pool with my Explorer troop. There were many signs asking the men to remove their shoes and boots before entering the change room. Many men did, but many men didn't. The change room floor had more dirt on if than the hallway where I ended up retreating to with my shoes and socks to finish dressing. While we were waiting to enter the pool a couple of men who were coming to pick up their kids after their swimming lessons blithly walked through the change room and the showers right up to the door into the pool without bothering remove their dirty, wet boots. Sigh.

01/20/08

  09:30:45 pm by wdawe, Categories: uncategorized

I was lying in bed last night and came up with a great idea for a blog posting. I didn't note it anywhere and now I have forgotten what it was. A few days ago I blogged that I was going to put up a poll for the new ELW worship book bur before I can do that I have to install some blog poll software.

Now that I have a blog that doesn't make me write posts two or three times I such have a pent up need to blog that I'll probably be posting like mad for the next while. Of course I said the same thing at Christmas and look what happened.

  06:28:54 pm by wdawe, Categories: uncategorized

When I decided to install b2evolution I took the release candidate because it was the newest version and I didn't want to upgrade when it became the official release. Unfortunately the documentation hasn't been updated to reflect where things are, or I couldn't find the info easily. Here are my suggestions on what to do to get going.

When you install you get two sample blogs. Don't delete them right away, they have useful information. Assuming you are starting with onr blog turn off blog B instead of deleting it. To turn it off log in to the admin interface, click on blog settings, blog B, features tab. Uncheck include in public blog list. Then rename Blog A to make it your blog. Keep the sample post for later reference to do this deprecate them rather than delete them. If you click on the edit button for the post and click on deprecate instead of delete.

Want to add something to the menu under the blog title, where Home and About this system appear. Click on write on the toolbar, select the first blog, then select the expert tab in the compose post window. Change the type field from Post to Page. Write the text you want on your page and click save. The new page should appear in the top bar, in alphabetical order. The Home and Contact links are different widgets so your added item will appear between them. If you want the item to only be a link fill in the Link to url field and leave the body of the page empty.

My first impression is that b2evolution is very capable and full featured but has a steep learning curve.

  04:41:20 pm by wdawe, Categories: uncategorized

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

Execute the script using the url of your last blog post as the argument
./get http://ca.blog.360.yahoo.com/blog-hwLjH.Myfxxxx8RH6xCteD6OzzzzzrB?p=287

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.

01/19/08

  07:20:58 am by wdawe, Categories: tv

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.

::

Cool web tools, EEPC tips and Linux info. Browse around, I'm sure you will find something to interest you.

Search

  XML Feeds

Web Site Builder