Runcible Blog

Phickle

 Before joining Tabblo I used Gallery for sharing photos online.  Although I haven't used it much since, spammers have been hammering the albums with comment spam.  I didn't realize the extent of it until today, and I wanted to clear out the noise.  Unfortunately, the administration interface doesn't make deleting 1000 comments easy.  I started to make a script to help me delete them.

Gallery uses a big serialized php array to store the album data and the comments, which is simple but braindead.  That means I'd have to unserialize the blob and delete the comments from the data structure.  Of course, I wasn't about to write something in PHP when Python's my bread and butter.

I found the existing Python implementations of PHP serialization either unpythonic or broken, so I wrote my own, inspired heavily by Python's pickle module.  

It's called phickle.py, and you can look at it or download it if it's of any use.

Maybe I'll link to the comment-pruning script, too, after I clean it up a bit.