Re: Nine digit zip codes

2010-11-30 Thread Peter Haworth

Yep, makes sense, especially if they sell those zip+4 lists.

Kind of related, has anyone had any experience with selecting zip  
codes based on a given zip code and a radius from it?  A mailing list  
I use has that feature to target newsletters and would be a handy  
function to have.  I'm guessing it must have some sort of latitude/ 
longitude calculation in there.


Pete Haworth

On Nov 30, 2010, at 4:42 PM, Bob Sneidar wrote:

Right, but not a lot from one place. I think their acceptable use  
would be under 30 or 40 hits a day from one IP, but if they get  
thousands, I think someone might contact you. They have some kind of  
published Acceptable Use policy on the site don't they? If not, then  
I guess you are in the clear.


Bob


On Nov 30, 2010, at 4:09 PM, Peter Haworth wrote:

USPS has a zip code lookup feature on their web site and seems like  
they would expect a lot of people using it


Pete Haworth

On Nov 30, 2010, at 2:14 PM, Bob Sneidar wrote:

Also be advised that too many hits from one place may result in  
alarms going off. It may have changes since I thought about doing  
this way back when, but they offered this site as a way for the  
every day user to get a zip+4, not for a commercial app to do it  
on the cheap as a way to avoid paying for the zip+4 database,  
which back then at least they charged you for.


Bob


On Nov 27, 2010, at 12:50 PM, stephen barncard wrote:

If you want to do it the 'right' way you might consider getting  
an API
keythen you can be sure it will continuously work - screen  
scraping may

fail if they change the website.

The  USPS appears to have extensive APIs available - looks like  
it talks

XML..

http://www.usps.com/webtools/address.htm

http://www.usps.com/webtools/htm/Development-Guide-v3-0b.htm



On 27 November 2010 09:53, James Hurley  
 wrote:



I sent this message a while back, but I suspect it got lost in the
RunRev-LiveCode changeover.

At the USPS web site (http://zip4.usps.com/zip4/) it is possible  
by
entering the street address, the city and the state to obtain  
the 9 digit

zip code for that address.

This may be naive, but is it possible to do this from within  
LiveCode by

script?

Jim



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





--



Stephen Barncard
San Francisco Ca. USA

more about sqb  
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-30 Thread Bob Sneidar
Right, but not a lot from one place. I think their acceptable use would be 
under 30 or 40 hits a day from one IP, but if they get thousands, I think 
someone might contact you. They have some kind of published Acceptable Use 
policy on the site don't they? If not, then I guess you are in the clear. 

Bob


On Nov 30, 2010, at 4:09 PM, Peter Haworth wrote:

> USPS has a zip code lookup feature on their web site and seems like they 
> would expect a lot of people using it
> 
> Pete Haworth
> 
> On Nov 30, 2010, at 2:14 PM, Bob Sneidar wrote:
> 
>> Also be advised that too many hits from one place may result in alarms going 
>> off. It may have changes since I thought about doing this way back when, but 
>> they offered this site as a way for the every day user to get a zip+4, not 
>> for a commercial app to do it on the cheap as a way to avoid paying for the 
>> zip+4 database, which back then at least they charged you for.
>> 
>> Bob
>> 
>> 
>> On Nov 27, 2010, at 12:50 PM, stephen barncard wrote:
>> 
>>> If you want to do it the 'right' way you might consider getting an API
>>> keythen you can be sure it will continuously work - screen scraping may
>>> fail if they change the website.
>>> 
>>> The  USPS appears to have extensive APIs available - looks like it talks
>>> XML..
>>> 
>>> http://www.usps.com/webtools/address.htm
>>> 
>>> http://www.usps.com/webtools/htm/Development-Guide-v3-0b.htm
>>> 
>>> 
>>> 
>>> On 27 November 2010 09:53, James Hurley  wrote:
>>> 
 I sent this message a while back, but I suspect it got lost in the
 RunRev-LiveCode changeover.
 
 At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
 entering the street address, the city and the state to obtain the 9 digit
 zip code for that address.
 
 This may be naive, but is it possible to do this from within LiveCode by
 script?
 
 Jim
 
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> 
>>> 
>>> Stephen Barncard
>>> San Francisco Ca. USA
>>> 
>>> more about sqb  
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-30 Thread Peter Haworth
USPS has a zip code lookup feature on their web site and seems like  
they would expect a lot of people using it


Pete Haworth

On Nov 30, 2010, at 2:14 PM, Bob Sneidar wrote:

Also be advised that too many hits from one place may result in  
alarms going off. It may have changes since I thought about doing  
this way back when, but they offered this site as a way for the  
every day user to get a zip+4, not for a commercial app to do it on  
the cheap as a way to avoid paying for the zip+4 database, which  
back then at least they charged you for.


Bob


On Nov 27, 2010, at 12:50 PM, stephen barncard wrote:

If you want to do it the 'right' way you might consider getting an  
API
keythen you can be sure it will continuously work - screen  
scraping may

fail if they change the website.

The  USPS appears to have extensive APIs available - looks like it  
talks

XML..

http://www.usps.com/webtools/address.htm

http://www.usps.com/webtools/htm/Development-Guide-v3-0b.htm



On 27 November 2010 09:53, James Hurley   
wrote:



I sent this message a while back, but I suspect it got lost in the
RunRev-LiveCode changeover.

At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
entering the street address, the city and the state to obtain the  
9 digit

zip code for that address.

This may be naive, but is it possible to do this from within  
LiveCode by

script?

Jim



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





--



Stephen Barncard
San Francisco Ca. USA

more about sqb  
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-30 Thread James Hurley

Peter,

I have also found this ability to feed addresses to Google Maps  
useful, but I normally do this in FileMaker. (I do a lot of database  
work around election time for local candidates. The Google maps come  
particularly handy in composing Walking Lists for volunteers.)


Using the template from Richard I have been able to work up a stack  
that allows one to batch process a list of addresses to obtain the 9  
digit zip codes. This is critical if one is doing bulk mailing--where  
the 9 digit zip is required. Parsing out the zip code is very easy.


These lists can be purchased but they are very expensive, running into  
the hundreds and thousands of dollars.


I have still been unable (even with Richard's help) to construct for  
myself the template that is to be POSTed to the US Postal Service web  
site. Pity--I'm sure this would be a useful thing to know for future  
applications.


I have placed the stack on Rev Online under the title:

   "Get 9 digit zip codes."

So now I have two stacks focusing on the digit nine;  "Nine ball pool"  
and "Get 9 digit zip code." My next foray into the digit nine will be  
a stack to retrieve 9 digit social security numbers. Now that will be  
particularly interesting.  :-)


Jim




Message: 23
Date: Tue, 30 Nov 2010 08:06:26 -0500
From: Peter Brigham MD 
To: How to use LiveCode 
Subject: Re: Nine digit zip codes
Message-ID: <5f95fd09-ec86-4c81-ae6e-be96bcbba...@gmail.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

FWIW, I have a handler that feeds the address to Google Maps and then
parses the HTML to extract the 5-digit zip code. Takes less than a
second unless the traffic is high. I'm pretty good at text parsing but
know very little about XML and GET/POST commands -- I had to look
around to find a webpage that I could post the address using straight
HTML rather than Java or SQL or whatever, and Google Maps was it. Only
a 5-digit zip, though.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Nov 27, 2010, at 12:53 PM, James Hurley wrote:


I sent this message a while back, but I suspect it got lost in the
RunRev-LiveCode changeover.

At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
entering the street address, the city and the state to obtain the 9
digit zip code for that address.

This may be naive, but is it possible to do this from within
LiveCode by script?

Jim







___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-30 Thread Bob Sneidar
Also be advised that too many hits from one place may result in alarms going 
off. It may have changes since I thought about doing this way back when, but 
they offered this site as a way for the every day user to get a zip+4, not for 
a commercial app to do it on the cheap as a way to avoid paying for the zip+4 
database, which back then at least they charged you for. 

Bob


On Nov 27, 2010, at 12:50 PM, stephen barncard wrote:

> If you want to do it the 'right' way you might consider getting an API
> keythen you can be sure it will continuously work - screen scraping may
> fail if they change the website.
> 
> The  USPS appears to have extensive APIs available - looks like it talks
> XML..
> 
> http://www.usps.com/webtools/address.htm
> 
> http://www.usps.com/webtools/htm/Development-Guide-v3-0b.htm
> 
> 
> 
> On 27 November 2010 09:53, James Hurley  wrote:
> 
>> I sent this message a while back, but I suspect it got lost in the
>> RunRev-LiveCode changeover.
>> 
>> At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
>> entering the street address, the city and the state to obtain the 9 digit
>> zip code for that address.
>> 
>> This may be naive, but is it possible to do this from within LiveCode by
>> script?
>> 
>> Jim
>> 
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> 
> -- 
> 
> 
> 
> Stephen Barncard
> San Francisco Ca. USA
> 
> more about sqb  
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-30 Thread Peter Brigham MD
FWIW, I have a handler that feeds the address to Google Maps and then  
parses the HTML to extract the 5-digit zip code. Takes less than a  
second unless the traffic is high. I'm pretty good at text parsing but  
know very little about XML and GET/POST commands -- I had to look  
around to find a webpage that I could post the address using straight  
HTML rather than Java or SQL or whatever, and Google Maps was it. Only  
a 5-digit zip, though.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Nov 27, 2010, at 12:53 PM, James Hurley wrote:

I sent this message a while back, but I suspect it got lost in the  
RunRev-LiveCode changeover.


At the USPS web site (http://zip4.usps.com/zip4/) it is possible by  
entering the street address, the city and the state to obtain the 9  
digit zip code for that address.


This may be naive, but is it possible to do this from within  
LiveCode by script?


Jim



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-28 Thread Jim Ault
As Kee Nethery said, the answer to the names of the variables is in  
the  section of the starting web page.

Spaces are not allowed in the GET string, thus the '+' char.
You could use LCode urlEncode(GetString) to be sure all chars  
necessary are converted before sending a GET to a web server.


One of the plugins or addons for Firefox that helps you see what is  
happening between the browser and web server is Live HTTP Headers.   
Caution when using this kind of addon... it will supply more info than  
most people ever want know about web server commands.


One extra note.  Some web pages have more that one FORM, so you need  
to locate the correct one to build the expected GET string.



On Nov 28, 2010, at 8:20 AM, James Hurley wrote:


Jim,

Thanks. Good explanation.

But I still wonder where RIchard came up with the input to the GET  
command, namely:


visited 
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Find 
+ZIP+Code


I can use it as template to find the nine digit zip code for any  
address and so my problem is solved, but I would like to know where  
it comes from. I am missing something that I may need the next time.


Thanks again,

Jim Hurley


Jim Ault
Las Vegas



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-28 Thread Kee Nethery
In general. 

Open the web page, view source, find the form tags and for every variable 
within the form tags, create a tag= value. If there are hidden fields and radio 
buttons, just look at the HTML specs to see how to format those tags in the GET 
statement. Make sure you URL encode the data after the tag= if you are using a 
GET.

I'm guessing there is a plugin for firefox that would catch the GET or POSt 
that gets submitted from a browser but I do this so infrequently that I have 
not searched for it. Someone else on this list probably has that answer.

Kee Nethery

On Nov 28, 2010, at 8:20 AM, James Hurley wrote:

> 
> But I still wonder where RIchard came up with the input to the GET command, 
> namely:
> 
> visited=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los+angeles&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Find+ZIP+Code
> 
> I can use it as template to find the nine digit zip code for any address and 
> so my problem is solved, but I would like to know where it comes from. I am 
> missing something that I may need the next time.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-28 Thread James Hurley

Jim,

Thanks. Good explanation.

But I still wonder where RIchard came up with the input to the GET  
command, namely:


visited 
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Find 
+ZIP+Code


I can use it as template to find the nine digit zip code for any  
address and so my problem is solved, but I would like to know where it  
comes from. I am missing something that I may need the next time.


Thanks again,

Jim Hurley




Message: 18
Date: Sun, 28 Nov 2010 04:18:13 -0800
From: Jim Ault 
To: How to use LiveCode 
Subject: Re: Nine digit zip codes Oops
Message-ID: <8652e41f-85a2-42b1-af22-5a61fbc60...@yahoo.com>
Content-Type: text/plain;   charset=US-ASCII;   format=flowed;  
delsp=yes

The 'submit' button on a page will do one of two things.  Either
  send a GET string
  send a POST message
-- I meant to add this --

The USPS page uses 'post', as shown on the line below

where action-> the script (handler),
and the method tells the script to look inside the $_POST array for
data that has been passed.
BUT , your browser runs a javascript before sending, and validates the
form
 (search for 'function validate(field) { // check if input ok )
--

The GET is a simple method of send a web page address & the data  
pairs.

- this method has a limit of about 1000 chars and is sent so that a
program sniffing packets can see the entire string

The POST is a more capable method that sends the web page address &
another message block that can contain a variety of encoded data.
- this method does not have a limit and the variables cannot be
sniffed if sent using SSL. or encryption, etc.

In your case, the LC 'post' command is the 'submit' button action.
In the LC library, the web page address and the message are formatted
for you

Think of the receiving web page as a hander in LC.
The post message calls the handler and passes the variables defined by
 pVar1=string&pVar2=integer&pVar3=state&pVar4=city

Now the server program gets called, crunches, and returns what it is
programmed to return, just like a LC handler or function.

The POST command can also send images (as binary endoded as a text
block), sounds, videos, files, etc.
The key is to format the message so that the sever program can know
how to decode the text and where the parts begin and end, if multiple
parts are sent in one message.  This is the function of 'multi-part
boundaries' (long random strings that divide the parts)

On Nov 27, 2010, at 3:46 PM, James Hurley wrote:


Richard,

I'm beginning to get it. I should put


visited
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los
+
angeles
&state 
=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin




into field 1--or, of course, the data appropriate to my addresses.

But where did this "visited" line come from? Where in the process of
sending the "submit" does this line present itself?

Jim





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes Oops

2010-11-28 Thread Jim Ault

The 'submit' button on a page will do one of two things.  Either
  send a GET string
  send a POST message
-- I meant to add this --

The USPS page uses 'post', as shown on the line below
OnSubmit="return validate(form1)">

where action-> the script (handler),
and the method tells the script to look inside the $_POST array for  
data that has been passed.
BUT , your browser runs a javascript before sending, and validates the  
form

 (search for 'function validate(field) { // check if input ok )
--

The GET is a simple method of send a web page address & the data pairs.
- this method has a limit of about 1000 chars and is sent so that a  
program sniffing packets can see the entire string


The POST is a more capable method that sends the web page address &  
another message block that can contain a variety of encoded data.
- this method does not have a limit and the variables cannot be  
sniffed if sent using SSL. or encryption, etc.


In your case, the LC 'post' command is the 'submit' button action.
In the LC library, the web page address and the message are formatted  
for you


Think of the receiving web page as a hander in LC.
The post message calls the handler and passes the variables defined by
 pVar1=string&pVar2=integer&pVar3=state&pVar4=city

Now the server program gets called, crunches, and returns what it is  
programmed to return, just like a LC handler or function.


The POST command can also send images (as binary endoded as a text  
block), sounds, videos, files, etc.
The key is to format the message so that the sever program can know  
how to decode the text and where the parts begin and end, if multiple  
parts are sent in one message.  This is the function of 'multi-part  
boundaries' (long random strings that divide the parts)


On Nov 27, 2010, at 3:46 PM, James Hurley wrote:


Richard,

I'm beginning to get it. I should put


visited
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin




into field 1--or, of course, the data appropriate to my addresses.

But where did this "visited" line come from? Where in the process of  
sending the "submit" does this line present itself?


Jim




Richard,

Thanks. I am astonished that this is possible.

I'm afraid I am missing something. I tried entering my data (my  
home address--it appears that is what you did) in the USPS page

http://zip4.usps.com/zip4/


I then copied and pasted that source code into field 1 in LiveCode.  
(I didn't see any reference to my data--my address--in that html  
text.)


I used your script in a button and obtained some html text in field  
2. But there is no reference in field 2 to my street address.


I don't mind working on the parsing to do the put and get, but I'm  
sure I missing the ingredient where my data (address, city and St)  
goes into field 1. I think that is what I am missing.


I don't see "visited=1&pagenumber=0 etc. anywhere in field 1 or 2.

Floundering,

Jim




Jim Ault
Las Vegas



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes.

2010-11-27 Thread Shao Sean
The POST is a more capable method that sends the web page address &  
another message that can contain a variety of encoded data. - this  
method does not have a limit and the variables cannot be sniffed


Yes they can.. anything being sent from your computer to the server  
(GET or POST) can be sniffed.. Using SSL and other forms of secured  
connections (or even encrypting the data before sending) will protect  
the data..


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes.

2010-11-27 Thread Jim Ault

The 'submit' button on a page will do one of two things.  Either
  send a GET string
  send a POST message
The USPS page uses"

The GET is a simple method of send a web page address & the data pairs.
- this method has a limit of about 1000 chars and is sent so that a  
program sniffing packets can see the entire string


The POST is a more capable method that sends the web page address &  
another message that can contain a variety of encoded data.

- this method does not have a limit and the variables cannot be sniffed

In your case, the LC 'post' command is the 'submit' button action.
In the LC library, the web page address and the message are formatted  
for you


Think of the receiving web page as a hander in LC.
The post message calls the handler and passes the variables defined by
 pVar1=string&pVar2=integer&pVar3=state&pVar4=city

Now the server program gets called, crunches, and returns what it is  
programmed to return, just like a LC handler or function.


The POST command can also send images (as binary endoded as a text  
block), sounds, videos, files, etc.
The key is to format the message so that the sever program can know  
how to decode the text and where the parts begin and end, if multiple  
parts are sent in one message.  This is the function of 'multi-part  
boundaries' (long random strings that divide the parts)


On Nov 27, 2010, at 3:46 PM, James Hurley wrote:


Richard,

I'm beginning to get it. I should put


visited
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin




into field 1--or, of course, the data appropriate to my addresses.

But where did this "visited" line come from? Where in the process of  
sending the "submit" does this line present itself?


Jim




Richard,

Thanks. I am astonished that this is possible.

I'm afraid I am missing something. I tried entering my data (my  
home address--it appears that is what you did) in the USPS page

http://zip4.usps.com/zip4/


I then copied and pasted that source code into field 1 in LiveCode.  
(I didn't see any reference to my data--my address--in that html  
text.)


I used your script in a button and obtained some html text in field  
2. But there is no reference in field 2 to my street address.


I don't mind working on the parsing to do the put and get, but I'm  
sure I missing the ingredient where my data (address, city and St)  
goes into field 1. I think that is what I am missing.


I don't see "visited=1&pagenumber=0 etc. anywhere in field 1 or 2.

Floundering,

Jim








James Hurley wrote:
> At the USPS web site (http://zip4.usps.com/zip4/) it is possible  
by
> entering the street address, the city and the state to obtain  
the 9

> digit zip code for that address.
>
> This may be naive, but is it possible to do this from within  
LiveCode

> by script?
Good news:  you can use the post command for that.
Bad news:  the result is HTML, so you'll need to parse out the  
relevant

parts.

To test I made a stack with a button and two fields - here's the  
script
for the button, using the URL derived from the HTML source of the  
form

element in that page:

on mouseUp
 post fld 1 to url "http://zip4.usps.com/zip4/zcl_0_results.jsp";
 set the htmlText of fld 2 to it
end mouseUp

Field 1 contains form element names and values, packaged up in the

name=value format used by both POST and GET:

visited 
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin


Field 2 will contain the HTML once the request is returned.  Now  
for the

tedious parsing to get the parts you want
--
Richard Gaskin
Fourth World
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
LiveCode Journal blog: http://LiveCodejournal.com/blog.irv





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode


Jim Ault
Las Vegas



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes.

2010-11-27 Thread Jim Ault


The key section of the reply
   [ url http://zip4.usps.com/zip4/zcl_0_results.jsp   ] is

style="background:url(images/table_gray.gif); padding:5px 10px;">


9876 W CHARLESTON BLVD APT 2555

LAS VEGAS NV  89117-7061


   
and here is the code I would use to parse for the zip
(keeping it simple)
on parseZipExample
   -- I copied the source window, so
   put the clipboarddata into htmlPage --
   replace " " with cr in htmlPage
   filter htmlPage with "?-"
   filter htmlPage without "*--*"
   filter htmlPage without empty
   ;put htmlPage  --into msgbox
end parseZipExample

Modify to suit your program.

On Nov 27, 2010, at 3:22 PM, James Hurley wrote:


Richard,

Thanks. I am astonished that this is possible.

I'm afraid I am missing something. I tried entering my data (my home  
address--it appears that is what you did) in the USPS page

http://zip4.usps.com/zip4/


I then copied and pasted that source code into field 1 in LiveCode.  
(I didn't see any reference to my data--my address--in that html  
text.)


I used your script in a button and obtained some html text in field  
2. But there is no reference in field 2 to my street address.


I don't mind working on the parsing to do the put and get, but I'm  
sure I missing the ingredient where my data (address, city and St)  
goes into field 1. I think that is what I am missing.


I don't see "visited=1&pagenumber=0 etc. anywhere in field 1 or 2.

Floundering,

Jim


Jim Ault
Las Vegas



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes.

2010-11-27 Thread James Hurley

Richard,

I'm beginning to get it. I should put


visited
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin




into field 1--or, of course, the data appropriate to my addresses.

But where did this "visited" line come from? Where in the process of  
sending the "submit" does this line present itself?


Jim




Richard,

Thanks. I am astonished that this is possible.

I'm afraid I am missing something. I tried entering my data (my home  
address--it appears that is what you did) in the USPS page

http://zip4.usps.com/zip4/


I then copied and pasted that source code into field 1 in LiveCode.  
(I didn't see any reference to my data--my address--in that html  
text.)


I used your script in a button and obtained some html text in field  
2. But there is no reference in field 2 to my street address.


I don't mind working on the parsing to do the put and get, but I'm  
sure I missing the ingredient where my data (address, city and St)  
goes into field 1. I think that is what I am missing.


I don't see "visited=1&pagenumber=0 etc. anywhere in field 1 or 2.

Floundering,

Jim








James Hurley wrote:
> At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
> entering the street address, the city and the state to obtain the 9
> digit zip code for that address.
>
> This may be naive, but is it possible to do this from within  
LiveCode

> by script?
Good news:  you can use the post command for that.
Bad news:  the result is HTML, so you'll need to parse out the  
relevant

parts.

To test I made a stack with a button and two fields - here's the  
script
for the button, using the URL derived from the HTML source of the  
form

element in that page:

on mouseUp
  post fld 1 to url "http://zip4.usps.com/zip4/zcl_0_results.jsp";
  set the htmlText of fld 2 to it
end mouseUp

Field 1 contains form element names and values, packaged up in the

name=value format used by both POST and GET:

visited 
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin


Field 2 will contain the HTML once the request is returned.  Now  
for the

tedious parsing to get the parts you want
--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes.

2010-11-27 Thread James Hurley

Richard,

Thanks. I am astonished that this is possible.

I'm afraid I am missing something. I tried entering my data (my home  
address--it appears that is what you did) in the USPS page

http://zip4.usps.com/zip4/


I then copied and pasted that source code into field 1 in LiveCode. (I  
didn't see any reference to my data--my address--in that html text.)


I used your script in a button and obtained some html text in field 2.  
But there is no reference in field 2 to my street address.


I don't mind working on the parsing to do the put and get, but I'm  
sure I missing the ingredient where my data (address, city and St)  
goes into field 1. I think that is what I am missing.


I don't see "visited=1&pagenumber=0 etc. anywhere in field 1 or 2.

Floundering,

Jim








James Hurley wrote:
> At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
> entering the street address, the city and the state to obtain the 9
> digit zip code for that address.
>
> This may be naive, but is it possible to do this from within  
LiveCode

> by script?
Good news:  you can use the post command for that.
Bad news:  the result is HTML, so you'll need to parse out the  
relevant

parts.

To test I made a stack with a button and two fields - here's the  
script

for the button, using the URL derived from the HTML source of the form
element in that page:

on mouseUp
   post fld 1 to url "http://zip4.usps.com/zip4/zcl_0_results.jsp";
   set the htmlText of fld 2 to it
end mouseUp

Field 1 contains form element names and values, packaged up in the

name=value format used by both POST and GET:

visited 
=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los 
+ 
angeles 
&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Fin


Field 2 will contain the HTML once the request is returned.  Now for  
the

tedious parsing to get the parts you want
--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-27 Thread stephen barncard
If you want to do it the 'right' way you might consider getting an API
keythen you can be sure it will continuously work - screen scraping may
fail if they change the website.

The  USPS appears to have extensive APIs available - looks like it talks
XML..

http://www.usps.com/webtools/address.htm

http://www.usps.com/webtools/htm/Development-Guide-v3-0b.htm



On 27 November 2010 09:53, James Hurley  wrote:

> I sent this message a while back, but I suspect it got lost in the
> RunRev-LiveCode changeover.
>
> At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
> entering the street address, the city and the state to obtain the 9 digit
> zip code for that address.
>
> This may be naive, but is it possible to do this from within LiveCode by
> script?
>
> Jim
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Nine digit zip codes

2010-11-27 Thread Richard Gaskin

James Hurley wrote:


At the USPS web site (http://zip4.usps.com/zip4/) it is possible by
entering the street address, the city and the state to obtain the 9
digit zip code for that address.

This may be naive, but is it possible to do this from within LiveCode
by script?


Good news:  you can use the post command for that.

Bad news:  the result is HTML, so you'll need to parse out the relevant 
parts.


To test I made a stack with a button and two fields - here's the script 
for the button, using the URL derived from the HTML source of the form 
element in that page:


on mouseUp
  post fld 1 to url "http://zip4.usps.com/zip4/zcl_0_results.jsp";
  set the htmlText of fld 2 to it
end mouseUp

Field 1 contains form element names and values, packaged up in the 
name=value format used by both POST and GET:


visited=1&pagenumber=0&firmname=&address2=620+moulton&address1=&city=los+angeles&state=ca&urbanization=&zip5=90031&submit.x=48&submit.y=8&submit=Find+ZIP+Code


Field 2 will contain the HTML once the request is returned.  Now for the 
tedious parsing to get the parts you want


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Nine digit zip codes

2010-11-27 Thread James Hurley
I sent this message a while back, but I suspect it got lost in the  
RunRev-LiveCode changeover.


At the USPS web site (http://zip4.usps.com/zip4/) it is possible by  
entering the street address, the city and the state to obtain the 9  
digit zip code for that address.


This may be naive, but is it possible to do this from within LiveCode  
by script?


Jim



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode