Gopher Mirror and Site Redesign
Published: January 12, 2008Tags: python gopher
Happy new year, everybody. On a quick personal note, I am a married man now (as of December 15, 2007, photos to be uploaded soon) and am off for a 3 week honeymoon in Europe (with a quick stop in Japan on the way to visit some good friends who missed the wedding) in just over a week.
You may have noticed that my website has changed a little in appearance over the past week. Some pages are probably throwing 404s or the like, as well. There's something of a lengthy backround story to this, which I'll share in this blog entry.
About a month ago, I discovered Gopher, an old (very early 90s) internet protocol for providing menu-driven access to hierarchically structured plaintext data. Gopher was basically the pre-cursor to the World Wide Web we know today. I had heard of Gopher before (in the Python standard library documentation, amongst other places), but didn't know much about it and certainly had never tried it. Now I have, and I've decided that I like it. A lot. Admittedly this is partially because of its "retro charm", but also because by forcing a hierarcical structure and removing all aspects of visual design, Gopher perfectly represents the the philosophy of information sharing that the internet was built on, while simultaneously achieving levels of speed, ease of use and elegence which have completely vanished from the modern web. This is the kind of thing I really enjoy.
Oh, and there's no adverts.
I decided that I would like to mirror this website in Gopherspace, for the learning experience and the fun of it, as something of a statement of my preference for simplicity in computing and - admittedly - on account of the fact that according to automated Goperspace searching tools, doing so would make me administrator of the only Gopher server in Australia! Serious geek credit. I'm really quite incredulous of this fact, but it seems to be true. It is also reported that "There are no known gopher servers in Africa, Eurasia, the Middle East or the Indian subcontinent". What are the geeks of the world doing, honestly?
To this end, I have spent the last week or so redesigning the way my site is managed. This had always been a fairly ad hoc afair, with lots of ugly PHP scripts (eww), hand written HTML code and rather more manual work than I'd have liked involved in even simple layout changes, etc. The need to conveniently make the same content available over two different protocols (HTTP and Gopher) in two different formats (HTML and plain text) demanded a complete overhaul, and I'm happy to report that something quite flexible and usable appears to be emerging from my work in this direction.
PHP is out and Python scripts are (as they probably always should have been) in. I am using the Cheeltah templating engine (devel/py-cheetah in pkgsrc) to do the grunt work. I write all of my articles in Markdown, as plain text files which are free of any metadata like titles, subtitles, keywords, etc. This metadata is stored in a configuration file compatible with the ConfigParser module in the Python standard library. A simple script reads the content files and the metadata and then passes that information to Cheetah templates - one set of templates handles the creation of my website (the Markdown is first transformed into HTML by "Markdown in Python", /textproc/py-markdown in pkgsrc), another set of templates handles the creation of my Gopherspace, where pages are served up in their original Markdown, which is relatively readable. I am in the process of writing a script to also update an RSS feed whenever a new article runs through the above process, so that people can readily keep track of updates to my site. Surprisingly, there is not a lot of good code out there for generating RSS feeds with Python. I am putting something together using effbot.org's ElementTree library, working from this handy example.
This whole new system works rather nicely and I am happy that managing my website from now on will be easy, flexible and Pythonic. But even moreso I am happy with how easily and quickly the system has come together. By using existing free software projects and making design decisions which leverage Python's strengths (like using ConfigParser comapitlbe config files) I feel like I have made a working product in an amount of time so short it is completely out of proportion to the product's functionality. It's still quite ugly and unpolished at the moment, but I think that I will work on it over time and hopefully end up releasing at least parts of it on this website eventually.
Anyway, the end result for you of all this is that you can now point something - either a proper Gopher client (try net/gopher in pkgsrc) or a web browser that supports Gopher (Firefox is one) - to luke.maurits.id.au) on port 70 and see this site mirrored in Gopherspace! It's a bit messy for now, but I do hope to clean it up soon. The server I am using is PyGopherd (/net/pygopherd in pkgsrc), a modern Gopher server written, of course, in Python.
Enjoy the anachronism!