As Jim says, there are placefiles that already exist, and even if you could get that info from WU, they most likely have it patented or its equivalent.
http://www.redteamwx.com/grlevelx.html - Donationware site that has such placefiles available, as does Allisonhouse (requires a subscription).
Writing the script is the easy part, getting access to said data is the difficult and expensive part, as you would need access to a NOAAPort system to get said data.
John