|
|
|
| January 2003 |
| Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
| |
|
|
1 |
2 |
3 |
4 |
| 5 |
6 |
7 |
8 |
9 |
10 |
11 |
| 12 |
13 |
14 |
15 |
16 |
17 |
18 |
| 19 |
20 |
21 |
22 |
23 |
24 |
25 |
| 26 |
27 |
28 |
29 |
30 |
31 |
|
| Dec Feb |
Blogchalk:
Portsmouth, NH, US
|
|
|
|
|
|
Monday, January 13, 2003
I said here and here that it was time for a change, and here goes. This is a list of how I switched from Radio to blosxom, and a couple of tools I built along the way.
Part One, Setting up Your New Weblog
- Convert all of your old Radio posts to blosxom-style posts. A blosxom-style post is simple: a text file, first line is the title. This script might come in handy. I stole it from somewhere and hacked it so it would work for the majority of my old posts. You might need to tweak it some more if your posts behave differently than mine.
- Install blosxom. This is a piece of cake.
- Get your templates in order. In my case, the rest of my site uses PHP. To include the output from blosxom in a PHP page (overkill? perhaps), use the following snippet of code.
$blogbody = shell_exec("/path/to/cgi-bin/blosxom.cgi?flav=fp");
$blogbody = preg_replace("/Content-Type:.*\n/", "", $blogbody);
echo $blogbody;
- Note the use of the "fp" flavor in that code. This is an empty head.fp and foot.fp: you'll already have head/foot for the page you're creating in PHP. Of course, if you're not stuck with PHP already, you can skip this.
- Upload your templates, old posts, and make sure everything works. (Honestly, at this point you should be making sure everything still works -- test out your basic blosxom installation before doing any of this.)
Part Two, Aggregation
This was the biggest hurdle I had to figure out. I like the way Radio is set up: I read news in the aggregator and occasionally post them to my weblog with commentary. Sometimes I use RadioExpress to post items while I'm surfing. How to get the same effect with blosxom?
I'm using a slightly-hacked version of blagg for aggregation.
Hacks to blagg include:
- Decode ', which is a Radio-generated entity in many feeds.
- Place downloaded items into separate directory for each feed. This allows you to browse posts from a single source in blosxom.
- Lastly, the main enabling hack: Blagg saves posts in files called TITLE.txt, based on the title of the item. If TITLE.txt exists, it ignores the item. I added a check for "TITLE.txt_del", so that there's a way of effectively marking items deleted (blosxom won't display files that don't end in .txt) without blagg continually re-creating an old post.
Part 3, Editing and Posting
I decided to use a simple uploader script I wrote a while back to send posts to my server.
I'm editing posts in emacs.
My next hack: blwip. (Say "bullwhip".) The bl is blosxom, the wip is work-in-progress. It is a CGI post manager that runs on your local webserver. (You do have apache installed on your computer, right?) blwip is a little (ok, very) rough around the edges, but it works as follows. You have three directories: posts, wip, and agg. Posts are where your blog posts live -- this is the directory that gets uploaded to your server. Wip is where your work in progress lives. These are posts that you've started but haven't yet published. Agg is where incoming aggregator posts live. blwip has several modes: create a new wip post based on an agg post; delete an agg post; delete a wip post; publish a wip post to "posts"; list posts in progress; show a particular post in progress; and list the subscriptions you have configured for your aggregator. blwip works closely with blosxom and blagg, and requires that both are installed. The preceding sentences are all that exists for documentation right now. I'll get around to adding more in the near future.
Did I mention that, since blwip runs on the local machine, it takes the liberty of launching your editor with new posts? Yes, a wonderfully ugly hack. I love it.
Did I also mention that I'm am NOT a perl hacker and that blwip probably does many things the wrong way (although I have heard that TMTOWTDI or something like that).
This is all running on my windows machine with cygwin installed and uses a bizarre amalgam of native and cygwin tools. With any luck it might run somewhere else. Blosxom sets up and runs in 15 minutes. This may take slightly longer. If you let me know what parts suck, I can try to fix them.
- Anyway, to set it up put the blwip and blosxom scripts in your local machine's cgi-bin.
- Install (my modified) blagg, set up an rss.dat and run blagg to populate the aggregator.
- Use head, foot, and story based on mine.
- Point your browser at blosxom and you will see the news from your subscriptions along with "post" and "delete" controls. These items will call blwip to delete an agg post or create a wip post.
- If you're using my basic templates, there are also two nav items along the bottom: a pointer to your subscriptions list, which allows you to browse the news by provider, and a pointer to your posts in progres which allows you to manage your pending posts.
11:01:26 PM
#
Here are the pieces. converter.py to convert Radio posts to blosxom posts. A slightly modified blagg for use with blwip, which is a CGI script to manage posting from your news reader. And a set of templates for use with blwip.
11:59:18 PM
#
Friday, January 10, 2003
8:14:11 PM
#
Wednesday, January 08, 2003
Will Cox: Don't you just hate it when you've got a post almost finished, and you go looking for that last link to top it off, and poof! there it goes into the bitbucket.
Yup. That's why I have three buttons enabled in Radio. The Post button is a combination of Save and Preview. On any post longer than a sentence, I'll typically save/preview at least once before publishing. Though I still haven't quite figured out what the difference between Publish and Post & Publish is...
1:30:53 PM
#
Monday, December 30, 2002
7:16:32 PM
#
Sunday, December 29, 2002
5:10:37 PM
#
I tweaked untitledPost for safety. Note that my last post is still untitled. If there are HTML tags in the first sentence, the post remains untitled.
on untitledPost (adrpost) {
if not defined (adrpost^.title) {
local(title)
title = string(string.firstSentence (adrpost^.text))
endMarks = {"!", "?"}
for i = 1 to sizeOf(endMarks) {
if title contains endMarks[i] {
title = string.popSuffix (title, endMarks[i])
title = title + endMarks[i] } }
if not string.wildcardMatch(title, "<*>") {
adrpost^.title = title } } }
If anyone can tell me how to actually strip HTML tags (without resorting to brute force) from a string, I'll happily tweak it again.
5:15:23 PM
#
5:24:08 PM
#
And here's the final script.
on untitledPost (adrpost) {
if not defined (adrpost^.title) {
local(title)
title = string(string.firstSentence (adrpost^.text))
endMarks = {"!", "?"}
for i = 1 to sizeOf(endMarks) {
if title contains endMarks[i] {
title = string.popSuffix (title, endMarks[i])
title = title + endMarks[i] } }
adrpost^.title = searchEngine.stripMarkup(title) } }
Thanks to Andy Fragen for the original.
5:28:50 PM
#
You need a space after the period. Or firstSentence will pick up more than you expect!
5:37:03 PM
#
Friday, December 20, 2002
I just went looking to install RadioExpress again (moved computers a while back and had never installed it) and it had disappeared. It has a new home.
1:37:18 PM
#
Doc Searls: Why I hate computing.
Doc's experience is why it is (in my experience) vital to enable Use Three Buttons in Radio. You don't want to necessarily publish what you've got, but you want to save it. When you've got Three Buttons enabled, you'll probably want to add a couple of scripts for easier management of your work-in-progress.
Interesting that this comes up when I answered a specific question about this earlier this morning. That kind of thing seems to happen a lot.
5:12:32 PM
#
Wednesday, December 04, 2002
Don't mess with stuff. Messing with stuff makes bad things happen. This is a corollary of the "if it ain't broke" rule.
9:52:20 AM
#
Sometimes messing with something will break something that you would have thought was completely unrelated. Turns out that NOTHING is unrelated.
9:53:11 AM
#
|
© Copyright 2003 Brian St. Pierre.
Last update: 1/13/2003; 11:59:25 PM.
|
|
|