2005-01-03

Grav cache

Caching gravatars.

I thought it was an interesting idea.

So I implemented it, in the form of Grav cache.

There's no example due to the fact that lamp.inf.brad.ac.uk are idiots and don't have MySQLdb installed (come on, they don't have the only MySQL module I've seen for Python on a server called LAMP).

It has limitations, of course. Like it just uses Content-type: image/jpeg for whatever image simply because it works and I have no idea how to determine a MIME type from a plain image (without resorting to grepping for "PNG", "GIF", etc.).

Of course I can't get my own Gravatar. I expect I have to enable cookes or something. I'll try that tomorrow. But now it's time for bed.

1 Comments:

Anonymous Anonymous said...

I've just added this as a comment to Neil's Weblog, but thought I'd comment here as well.

I've ported your script to PHP, from the original Python version and it is available at http://www.colinogilvie.co.uk/misc/gravatar_cache.php.txt

I've made a couple of comments in the source code (for example, about the HTTP Request and the Content-Type) and also the storing of the image in the Database.

If you'd like to contact me about this you can reach me on gravatar_cache AT colinogilvie DOT co DOT uk

Colin

11:38 pm  

Post a Comment

<< Home