pyBlag


27/3/2011
Tags: pyBlag, blog, blogging, projects

So you might be asking yourself "What is this pyBlag thing?" or "Why does it say Powered by pyBlag on this guy's site?". pyBlag is a single, CGI script that I wrote in about three hours of a Sunday afternoon. Why did I do it? Why didn't I use ordinary content management software like Wordpress? Why did I create another blog, even though I already have one? The answer to these questions is that I thought it would be fun, and I thought it would be a cool thing to put as my McGill CS homepage. Writing a super simple CMS script didn't seem like too difficult a task, so I did it.

pyBlag has no backend. In other words, what you see here is the only interface to pyBlag; it is only one script. To add new posts, you have to manually add them into a very simple XML file. It's not that hard if you have a brain, can recognize patterns, and aren't afraid of "technology," but it's not as userfriendly as other CMS tools. That being said, the entire script weighs in at 3.9 kilobytes (at last count.) Needless to say, for what it is, I think it's pretty cool.

At some point I'll release the source code for pyBlag, but there are a few features I want to add first. I'll detail my progress on my CS blog (here,) for all to see. If you have any questions, please feel free to e-mail me at worldgnat (swirly a) gmail (dot) com. Yes, yes, I have a McGill e-mail address, but I prefer to separate my e-mails that need to be read immediately from my e-mails that can be read later (but which address is which?)

Third Post


27/3/2011
Tags: pyBlag, blog, blogging, projects, Starbucks

There: I fixed it. For those interested, I simply added a list of the posts, had my XML parsing code add the post text to a list, and then add the text one by one to the page. I think I'm finished for today. For the record, not including the time I've been thinking about how I would write this code, it has taken me two hours to write this script. It's 79 lines of code, including comments and whitespace.

... [Read More]

Second Post


27/3/2011
Tags: pyBlag, blog, blogging, projects

This is my second post! I don't think it's going to work though... because of the way I wrote the XML parsing portion of my script, I think this, the second post, is going to replace my first post. Unless, of course, the CS gods are smiling on me, and have decided to allow my computer to figure out what I meant to tell it to do instead of doing what I actually told it to do. I find this extremely unlikely.

Back to the text editor.

Hello World!


27/3/2011
Tags: pyBlag, blog, blogging, projects

Hello World! This is the first blog post ever written on my simple, feature-light, easy to use collection of blogging scripts, which I am calling pyBlag. You have to write the posts in html, and I'm actually writing this post directly into an XML file because I haven't actually writteng the post editing/creation script yet, but it looks like it's going to work pretty well. I decided to write this collection of scripts because I thought it would be fun. So far, it has been. Writing CGI scripts (or anything, for that matter,) in Python is pretty easy, and a lot of fun. I'll post the source code eventually.

The template file is a single html file and a single css file. This makes things a lot simpler to deal with. There are no fancy statistics features, though I'm thinking about writing a simple hit counter at some point. If you want a full-featured blogging application, go get Wordpress. This is just a fun project. Also, the total file size - themes and all - is a few kilobytes, and installation is as simple as copying a few files into your cgi-bin directory.