views:

76

answers:

3

Hello, I am trying to write a script that does a zip code look up at the USPS. URL="http://zip4.usps.com/zip4/citytown_zip.jsp". The data gets submitted by POST is:

zip5=YOURZIPCODE&submit.x=3&submit.y=22&submit=Find+ZIP+Code

The part I am having a hard time finding is how these numbers get generated: submit.x=3 submit.y=22

The above two always "submit" values for X and Y always change. I can figure out those number get put into the string.

Any thoughts would be greatly appreciated.

+1  A: 

Those are the coordinates for a image-button click. Their values just give the mouse position on the button when it was clicked. In this case, they are going to be meaningless, just make them both 1 or something.

Erich
A: 

"Users may view and download material from this site only for the following purposes: (a) for personal, non-commercial home use"

http://www.usps.com/homearea/docs/termsofuse.htm?from=global%5Ffooter&page=termsofuse

From the link above.

anonymous_coward
A: 

As the first answer says, that is just the USPS trying to keep anyone from building an automated script to access data through that form. They expect slightly different numbers for each request from a given IP address.

"when you can prevent someone from doing something, you can get paid to allow them to get things done"

Just put in random numbers between 1 and the max size of the image button and it will work.

And I would not bother trying to do it "legally", their legal terms make no sense: http://techref.massmind.org/techref/ecommerce/shipAPIlegal.htm also see the "Shipping" link in the heading for that page.

James Newton