2011
08.19

It’s been a while

It’s been a while since I’ve wrote anything on here, and there’s been things happening, both in my life (I’m now in Australia) and over at TAN. Since this is the This Aint News shameless linkspam blog development blog, I should probably write about that.

So, what to write about? I guess I’ll start with the CPAN modules I’ve released from the TAN tree.

The first module I released was KinoSearchX::Simple, I think. I can’t be entirely sure, since it was quite a while ago! For those who don’t know, KinoSearch is very similar to Plucene, only it’s not an entirely abandoned project, and it’s very fast.

As the name implies, KinoSearchX::Simple is just a simple, Moose based, interface to KinoSearch1, that hides most of the hard work under the bonnet. It’s nice and simple to use, and works pretty well. I know of two places it’s used, one is in a search service at an old job I used to work at, and the other is on TAN itself.

One day I intend to rewrite it, perhaps Moose free, for KinoSearch3, which adds new features, and near realtime indexing. But that’s a task for another day.

Now I did have issues with this module and TAN the Catalyst application, in that when things got added to the index, because there was multiple copies of the index open in the different apache processes, sometimes they would be added repeatedly, or not at all. I solved that issue with the next module, which strangely is one of the newest I’ve released.

GearmanX::Simple::Worker – you’ll soon notice that there’s a pattern emerging here, with modules having the word “Simple” in them. Maybe that’s just me, but I like things to be easy ;)

So it wasn’t long ago when I wanted to create a TAN twitter page, with the recent promotions spammed off to twitter automatically. Seemed like a good idea, but I’m not really a fan of things that talk to other websites running in process.

Such as the sitemap pinger I had, which was a little script that ran 24/7 and used inotify to watch for a new file to tell it to tell the various search engines that there was new content in the sitemaps. This solution, as it sounds, isnt perfect, but it did the job and I never gave it anymore thought.

At one NWE.pm meeting though me, Rob and Matt were talking about jobservers, and that’s when I first learned about Gearman. So after a small discussion, and several beers, I was sold. The next week I decided I was going to kill 2 birds with one stone, and write the twitter spam script, and start using gearman.

Thus, GearmanX::Simple::Worker was born, which is now used for several things. Spamming twitter with new content, pinging the search engines, and adding content to the search index, which solved the issue with duplicate and missing content from the index.

My favourite one has to be Exception::Simple though, which is really really simple. This came about because once again at a NWE.pm meeting I heard about Try::Tiny, which I instantly loved. Although using it and using die(“blah”) just didn’t seem very nice to me. I looked around CPAN, and could only find heavy weight exception classes, even Exception::Lite seemed overly heavy for my needs. Then I stumbled upon Catalyst::Exception, which looked good and did exactly what I needed.

Though when I looked underneath it seemed to be a bit more complex than I needed. So then I made Exception::Simple which did everything I needed in under 70 lines of code. I released it and forgot about it, then one day out of the blue, I got an email and a patch, which made it more extensible to subclasses. Which made my day; it just shows, if you write it and release it, then someone out there might just use it, and even improve it, which is cool as!

Anyway, I’m bored of writing about modules now, especially since the other 3 are old, one collects an image from a remote website, the other validates its an image, and the other converts a url for a video into a html embed code. I’ll write something on these in a few years probably ;)

The reason I wrote this blog (other than the obvious link spam) was to show what I’d learned, and that was how to make a CPAN module. So I was gonna write a blog on using Module::Install, but this turned out not to be it, and it’s now dinner time. So maybe I’ll do that one next.

Who knows? Not me, that’s for sure.

 

 

No Comment.

Add Your Comment