Friday, April 27, 2007

Fixed Gcalc

The command line Google Calculator that I posted a while ago broke recently when Google changed the HTML on a page. However, the new HTML has div tag around the calculator answer, so it's now much easier to parse.

Anyway, the source and project files for the new gcalc can be downloaded from the original post. Or if you have the source yourself, the new XPath for the answer is .//div[@id='res']/table[1]/tr[1]/td[3]/font/b

1 comment:

Chinmoy said...

Hi Greg,

Thanks for this very useful tool. I built a very simple Cocoa front-end for your calculator(giving you credit for gcalc, of course).

It is a tad slower than gcalc, but it was just a small learning project for me :)

Regards,
Chinmoy

p.s. I uploaded the source and the binary from a Windows machine at work, so I haven't been able to check whether the download works correctly yet.