Yahoo WOEIDs

I need to make a stab a getting a whole load of yahoo WOEIDs. Doesn't matter if some are wrong but I don't fancy typing 1000 of them, I have 1000 place names and I'd like to grab just one WOEID for each... has anyone done anything like this before.

I figure I'll need to write a ruby program to do it.

Any clues I have no idea where to start.

I'd like to get a csv list with

PlaceName,SerialNumber,WOEID

The PlaceName and SerialNumber I have, the WOEID yahoo has.