objects with key at frame

I need a script that selects all objects that have position keys within a range of frames. Does anybody know if something like this already exists? If not, hints for writing it?