The Genealogy of SAFARI (Or How Blogging Revived Old Code)

By Timothy R Butler | Posted at 9:30 PM
Christopher asked an interesting question about my blogging software:
So the software that was running asIsaid was the great-granddaddy of Safari? Or are they different?

I've talked a lot about SAFARI on asisaid over the past year or so, but I've never really given it a formal introduction. Therefore, for anyone with time to kill, I present the Genealogy of SAFARI. It's a bit more complicated than a simple yes or no answer to the above question, and I'll seek to make the story interesting, so read on.

SAFARI (Standardized Automated Format and Retrieval Interface) began its life in 1999. I had a simple goal and wanted a simple solution: I was redesigning my church's web site and I wanted an easy way to post the entire church newsletter online. At the time, I had been tinkering with Perl for about two and a half years and thought I was a much better Perl wrangler than I really was. So I decided what every overambitious Perl programmer would decide: I'll write a content management system.

At the time, there were far less CMS's out there, I wasn't aware of more than a handful, and none of them did what I wanted — provide a way to sort articles by issue, a must for a monthly publication. I started working on SAFARI, and quickly started to realize the enormity of what I had taken on. I had no idea where to begin. But I trudged ahead, creating a relatively modular CMS that uses a flat-file database (that's a fancy term for a text file that stores your data), provided multiple levels of user access and eventually even a rudimentary search engine. In 2001, I released the code here, although honestly the code has some serious flaws which I knew, even at that time, needed to be corrected.

In fact, SAFARI was so focused on issue-based content, that I had to go with PHP-Nuke when I launched OfB, simply because SAFARI didn't work in the proper fashion for a normal internet publication. It was rather depressing, but laziness has a way of winning over pride, and so that was that. OfB was launched two months before I even released the SAFARI code, which made the release of SAFARI ever more depressing. However, SAFARI did serve its niche well, so I did release it with hopes that maybe someone would find it useful.

Blogging Days
My blog launched in February of 2002, at the time before blogging had really become all that well known. In fact, while I had heard the term, I had ignored the trend, and when my friend and fellow DMOZ-editor Ciaran Hamilton told me he had started a blog and offered his then-unreleased Journal script to use, I decided to give blogging a spin. This did compound the fact that within four months I had passed over using my own SAFARI script not once, but twice, but by that time I had given up any grand plans for SAFARI.

I did not have any real intentions with my blog. Given that Ciaran was the only blogger I knew, I didn't really do much with it for a few months. Given my minor amusement rather than serious interest in the idea, I didn't even start it with a proper, memorable entry. No, the entry, as immortalized in Christopher's In the Beginning post that catalog's many blogs' first posts, said rather un-eloquently:
Hiya! My friend Ciaran Hamilton gave me this nice script, waddya think?
How I wish I had the foresight that I'd still be blogging today. Eduardo started by invoking the muse from Homer's Illiad, I start with broken English that makes me cringe. But, I digress…

Ciaran's Journal code is probably one of the tightest blog codebases you will find. It is a compact, two file package that gets the job done well. I know that much, since it served me well from February 21, 2002 through December 23 of this past year, when it finally died for a reason I still do not know. During that time, I synchronized with his official code based once in November of 2002, after which I forked the code, adding commenting capabilities, a much more standard issue look (attempting to mimic MovableType somewhat) and a few other features.

This is the point at which my interest in blogging would become galvanized. Blogging was only so interesting when you didn't know if people were actually reading the posts. I know Ciaran and Kevin were at least occasional readers, but only because I knew them from elsewhere. It was my first post with commenting support that Christopher left a short comment and I realized I had a reader originating from the blogosphere — maybe I could get into this thing after all!

The Christian Directory Project (OpenMoz/FreeMoz)
Another important thread in this genealogy is the ill-fated FreeMoz project. FreeMoz is key for two reasons — first it is the project that brought me into contact with Ciaran and also some of the lessons in database design that I learned working on it figure into SAFARI later on. Long before my DMOZ-editorship lapsed, I made a post on the editors forums asking if anyone knew of a way to get the DMOZ codebase to create another specialized directory. Ciaran answered and after exploring the options, we decided to write our own replacement. I hacked the basics together in December of 2001, Ciaran added some much needed functionality and we would continue to work on it on-and-off for about a year. The project died, as Antony Flew would say, a death of a thousand qualifications, as we sought to garner support to develop the software needed to create a Christian variant of DMOZ. The impetus for the project was an issue, or I should say, issues with DMOZ, such as DMOZ's listing of X-rated material as well as the simple fact that “FaithMoz” could hopefully leverage the same concept to bring together a directory of Christian sites perhaps even better than DMOZ's, since there would not be as much “noise.”

Like SAFARI, building a whole directory project was a big deal. Hoping to attract developers to create the code-base, which would be useful for many directories, I began talks with Richard M. Stallman (RMS) of the Free Software Foundation about making the software, re-badged FreeMoz by RMS's request, an official GNU Project. We ended up getting bogged down in legal (i.e. avoiding infringement of AOL/Netscape's DMOZ) and editorial freedom issues, and the months we spent on that ended up killing off the momentum of the project. It was my fault for worrying to much about amassing major support, rather than the FSF's fault for worrying about legalities.

Back to SAFARI
In March of 2003, OfB was hacked, thanks to PHP-Nuke's poor security model. Having taken a week of vacation that very week, I resolved to spend the time figuring out a replacement for PHP-Nuke. I became convinced that all of the Nuke-spinoffs had issues, and blogging software simply wasn't quite right for a news site. What was I going to do? I decided it was time to revive SAFARI. However, SAFARI needed to be improved vastly for it to work on OfB. I would need to lose the issue based mentality of the CMS (or, more correctly, relegate it to one of several modes of viewing the content), add commenting, and most importantly, port the whole thing over to a SQL backend instead of the inefficient flat-file database.

I was able to do the last item within about three days, but after my work-vacation ended, I did not have time to finish the project. I also invested some time in fixing parts of PHP-Nuke, so I gave up the idea of bringing back SAFARI, once again. The promise of a really useful version of SAFARI, that I could use somewhere other than just my church's web site, was starting to seem like vaporware.

Over the next year, OfB would be compromised again and, at the same time, I started noticing things that were lacking in my forked version of Ciaran's Journal code. For example, I could not delete or edit posts or comments without editing the database manually (editing was especially tedious because the db was encoded). I also noticed that asisaid was becoming extremely slow and a huge resource hog, since each view of any post required the entire one megabyte database to be processed thoroughly. At some point, I resolved that I would make asisaid a test site for SAFARI, since it was a low traffic site and needed a needed a CMS — once I got SAFARI into a state where it worked satisfactorily here, I could move OfB to it as well.

Over the past year or so, every few weeks I'd take some time (usually a few hours) and start rewriting functions of SAFARI. I integrated the comment code I had written from my old Journal code, finished SQL-support and started implementing a more sensible theme system, similar to the one used by PHP-Nuke. The comment code is essentially SAFARI's only link to Ciaran's code, although it also incorporates some of the ideas from Journal codebase.

Back to Genealogy
If you've been following this byte-wasting toy of mine all the way to this point, you've probably noticed that SAFARI doesn't have a clear genealogy. SAFARI is an older codebase than Journal is, but it is also, in some senses, the decedent of Journal. Likewise, while porting SAFARI to SQL, I incorporated many of the ideas I had first tried out for FreeMoz, which had, conversely, borrowed some ideas from the original SAFARI. Once I complete the project, SAFARI 2 will probably have enough new code that it might be fair to say that it is the grandchild of SAFARI 0.9, Journal and FreeMoz, but it is not a simple linage at all.

Why I've kept working on SAFARI for so long could merit an entire essay of its own. Part of it is the practical reasons I've listed above, but in some ways, it may have been almost more efficient to start off with someone else's code base and grow from there. Another part is that SAFARI has almost taken on a life of its own — code, in that way, is sort of like poetry, I guess. It is sort of comforting to work on it, like talking with an old friend. Now that my old friend is approaching being a robust, modernized CMS, it is also becoming rewarding to look at my blog and realize all of this work has finally started to come to fruition.
Lastly, to believe themselves, when they tell you they will make you immortal by their verses. Thus doing, your name shall flourish in the printers` shops. Thus doing, you shall be of kin to many a poetical preface. Thus doing, you shall be most fair, most rich, most wise, most all; you shall dwell upon superlatives. Thus doing, though you be libertino patre natus, you shall suddenly grow Herculea proles — Sir Philip Sidney
Tags:

Well I find the story pretty fasinating. And the history of asIsaid interesting as well.
Posted by Christopher - Jan 10, 2005 | 4:42 AM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Oh, and fix your commenting preview! It didn't put the

tags in automatically which is why I had to add them. :D Didn't realise they'd show up in the comment. Also, when you post a comment it sends back the text of the comment before the HTTP header, which looks odd. Heh.

Posted by Ciaran - Jan 10, 2005 | 9:19 AM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Nice summary. I found it very interesting. One thing I want to respond to though... Ciaran's Journal code is probably one of the tightest blog codebases you will find. It is a compact, two file package that gets the job done well. I know that much, since it served me well from February 21, 2002 through December 23 of this past year, when it finally died for a reason I still do not know. It died insofar as I stopped working on it, basically because it was by that time defunct for me - I had started using LiveJouenal in September 2003 for my blogging, because of the community aspect, and because I had managed to obtain a LiveJournal code in January 2003 (which, if you'll remember, was the main reason I wrote the blog code in the first place). To cut a long story short, LiveJournal had proven itself to me through the community aspect of it - commenting, and so on. I could have added commenting to my own blod base - and actually I believe I asked you for your code at that point - but in the end I rrealised that LJ offers more than merely commenting anyway. Besides which, a whole group of my friends use LJ. In May this year I put the whole thing up on SourceForge, as I had been planning to do from the beginning, in the hope that people might be interested in working on it. Unfortunately no-one's taking any interest in it... I mentioned it here before but I don't know what you thought of it as you never commented. :( It is open for people to help develop though, if they want to contact me. The version currently available at SourceForge is newer than the version you were using, and supports things like templates and monthly archives. I'm especially proud of the templates feature myself. :) Oh, and I do still read your blog/journal. That's probably obvious though. :-D Oh, and fix your commenting preview! It didn't put the

tags in automatically, so I added them but then it showed up in the post. Thankfully you seem to have accidentally included a method for people to edit their posts by including the "id" parameter in the HTML code of the form itself... you really should look into that to stop people from replacing other people's posts. :D

Posted by Ciaran - Jan 10, 2005 | 9:22 AM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Um. I'm really, really, really sorry about all that. *hangs head in shame* Feel free to delete all my comments other than the one which is

less if you want, and edit it to take out the (wrong) comment about editing. :)

Posted by Ciaran - Jan 10, 2005 | 9:35 AM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Christopher: Thanks -- I didn't expect it to seem fascinating, but I'm glad it did. Just think, someday when SAFARI usage eclipses Movable-Type, you can say you had something to do with getting the ball rolling! Ciaran: I'll remove 'em Ciaran. :-) Actually the blog didn't die from lack of maintenance -- it really, really died. My blog quit working on December 23, that is. Your new code base is quite nice, I just didn't have the time (at the time) to reintegrate my commenting code, etc. And I really needed a SQL-based solution anyway.
Posted by Timothy R. Butler - Jan 10, 2005 | 8:26 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
testing
Posted by Timothy R. Butler - Jan 10, 2005 | 8:34 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Ciaran: don't worry about the mixups... especially since my preview screen still needs some work. BTW, I didn't mean to be away from your blog for so long -- but I forgot my LJ account and whenever I think about reading your blog I'm usually too lazy to reregister... I need to one of these days.
Posted by Timothy R. Butler - Jan 10, 2005 | 9:06 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
test
Posted by Timothy R. Butler - Jan 10, 2005 | 9:31 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
test
Posted by Timothy R. Butler - Jan 10, 2005 | 9:32 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
test
Posted by Timothy R. Butler - Jan 10, 2005 | 9:36 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
test Hey, everyone else is doing it.
Posted by Christopher - Jan 11, 2005 | 1:20 AM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Actually the blog didn't die from lack of maintenance -- it really, really died. My blog quit working on December 23, that is. Oh, you were referring to your own blog? Sorry, my mistake. I thought you were referring to my codebase, which also died - probably around about that time or earlier - for the same reasons.
Posted by Ciaran - Jan 11, 2005 | 12:03 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Also, I'm completely confused about the order of the comments here. ;) Some seem to be in reverse, others aren't...
Posted by Ciaran - Jan 11, 2005 | 12:05 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Yes Ciaran. It is very confusing.
Posted by Christopher - Jan 11, 2005 | 1:00 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Excellent and very interesting account. Btw, Tim, what do you think of scoop, the engine behind kuro5hin.org, for OfB ? It uses Perl instead of PHP.
Posted by Eduardo - Jan 11, 2005 | 1:55 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
Ciaran: I'm not sure what is going on with comment order. I thought I'd firxed that. *sigh* Eduardo: Thanks. Scoop is interesting -- I'm not really familiar with using it outside of a community driven/written site though, can it do that? It might be with considering if that's the case. Although I'm still leaning toward SAFARI, mostly because I've been taking care to reduce the number of SQL queries so that MySQL can stand up to Slashdot better. But, Scoop might do the same... What I do know is it is going to be a long time before I consider a PHP-based solution again. It seems as a rule that PHP is has a poorer security module than Perl (even prior to my most recent run-in with it in December).
Posted by Timothy R. Butler - Jan 11, 2005 | 5:08 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
The comment order was messed up because one of my comments had the wrong comment id number (a bug I fixed yesterday gave it id #1, rather than #1438, like it should have).
Posted by Timothy R. Butler - Jan 11, 2005 | 6:22 PM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
For anybody reading this, I just put a public entry into my own blog about this: http://www.livejournal.com/users/ciaran_h/38160.html?mode=reply
Posted by Ciaran - Jan 12, 2005 | 10:58 AM

Re: The Genealogy of SAFARI (Or How Blogging Revived Old Code)
I think scoop can handle OfB.biz very well, Tim. Check it out at their site; they have a list of external sites that use it. Of these, the most notorious one is Daily Kos :D.
Posted by Eduardo - Jan 12, 2005 | 11:54 AM