[CentOS] find latest version of rpms from a mirror

Thu Dec 10 06:50:59 UTC 2009
john blair <mailtome200420032002 at yahoo.com>

I want to write a script to find the latest version of rpm of a given package available from a mirror for eg: http://mirror.centos.org/centos/5/os/x86_64/CentOS/
Is there any existing script that does this? Or can someone give me a general idea on how to go about this?