Site Update

I had a little time this week, so I decided to rewrite my WordPress template. I liked the overall look of it, but I just customized somebody else’s work, and things were just a little off.

I’d never written a template for WordPress from scratch before, but it turns out to be pretty easy. I used the Blueprint CSS framework because I’ve really come to love using it, and I added a graphical logo to the header instead of plain text.

I also made changes to the categories.  I felt there were way to many, so I consolidated them into 5 areas.  After that, I think that it’s important to utilize tags instead of categories.  As a result, those of you who subscribe to my RSS feed probably saw a lot of old posts show up.  Sorry about that.  Wordpress automatically adds an edited post to the feed.

So, let me know what you think works, or doesn’t work.  If there’s a problem in a particular browser/OS, let me know that too.

Tags: , , ,
Time For a New Development Project

Even though I’ve been really busy with consulting work these last few months, I always seem to find time to start a new personal project.  It doesn’t seem to matter how busy I get actually.  There’s always so much to learn.  So many new technologies, methodologies, frameworks, platforms, you name it.  It never stops.

I think that the best way to learn these new things is by working on personal projects.  Especially, if you’re going to learn a few new things at once.  Otherwise, you may dig yourself into a hole that will take weeks to get out of.

So, my new project.  I’m writing a web-based bit-torrent interface for linux servers.  I haven’t quite decided which torrent client to wrap it around yet though.  It’s meant as a replacement for Torrentflux which I find a bit too cumbersom.  My vision is to build something more streamlined, both functionally and visually using PHP with CodeIgniter, Blueprint, and JQuery.

I’m sure this is going to take forever because I’m so busy, but it’s meant as a learning project as much as anything.  I’ll post updates as it progresses, and eventually the source code.

Tags: , , , , , , , , ,
Modified RSS Feeds

I’m a big RSS user. It’s my preferred method of keeping up to date with news, technology, blogs, and the odd comic.

One thing that’s always bugged me though was the poor implementation of RSS that most sites have. Many sites will just syndicate the headlines of their articles, making you visit the site to read the content. I understand that this is all because of advertising, but it’s still annoying.

Instead of just complaining about this like I normally would, I spent some time and created new feeds that deliver the content from some of these sites the way I like it. For example, penny-arcade.com (a web comic) doesn’t provide the actual comic strips in their feed. Just the title of the comic and a link back to the site.

I modified this feed to grab the actual image and insert it into the feed, and disregard all non-comic posts. I did the same thing for ctrlaltdel-online.com.

The most difficult site was Engrish.com. They don’t even have an RSS feed, so I had to build one by scraping their html page. Now, this wouldn’t have been much of a chore if the html was written properly, but it was tag soup in there.

It took about a day, but I’ve finally got 3 feeds that validate as RSS, and you can subscribe to them in your favourite reader at chriscraig.net/feeds.

If you know of a feed that needs som TLC like these, let me know. I might fix it up if it interests me too.

Enjoy!

Tags:
Ajax and IE Caching

One of the bugs features of Internet Explorer is it’s insistence on caching anything and everything. IE caching has cost me many hours of debugging time since I started doing Ajax development last year.

My most recent problem was a form I had that described an image. I would modify one of the fields in this form and save it, but the change didn’t reflect when I reloaded the page. After ruling out the PHP code and the database as the source of the bug, I did some research about caching in IE (since this problem didn’t occur in any other browser).

What I found was that you have to be careful when making ajax GET requests in IE. If you make a request to a URL with the same query string as another request made recently, IE figures that the page won’t have changed, so it pulls it from cache. Once I found this, it was a snap to avoid the problem.

There are two ways to handle this. One is to use POST request all the time. I don’t like to do this unless I’m submitting a form, so I use the second method which is to make the GET query string unique. I do this by adding a random string at the end:

http = createRequestObject();
var d = new Date();
var time = d.getTime();
var url = 'library.php?' + action + '&time=' + time;
http.open('GET', url,true);
http.onreadystatechange = handleResponse;
http.send(null);

This way, IE will never try to use a cached copy of your page.

Tags: ,
Another Re-Design

I was getting pretty tired of the Wordpress theme that I was using. I had played around with changing fonts and colours in the style sheet, but I haven’t been happy with the design for quite some time, so I decided to make my own theme.

I wanted something clean looking, so I decided to ditch the 2-column layout that everybody with a blog seems to use. Instead, I put all of the sidebar information at the bottom of the page, and limited the number of posts that show up on the front page. People visit my site to read the latest post, so that’s what I focused on.

I still have some work to do though, so what you see isn’t the final product. Let me know if you have any suggestions.

Tags: