Writing to a web site?

Jim Hurley jhurley at infostations.com
Mon Apr 11 11:18:02 EDT 2005


>
>Message: 15
>Date: Mon, 11 Apr 2005 13:39:45 +0100
>From: Dave Cragg <dcragg at lacscentre.co.uk>
>Subject: R
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <3ae49b344a769e72f050a184879fac89 at lacscentre.co.uk>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>
>
>On 11 Apr 2005, at 12:23, Jim Hurley wrote:
>
>>  This is something that is new to me and I have no understanding of the
>>  options.
>>
>>  I have considered using Run Rev to get the 4 additional numbers in zip
>>  codes.
>>
>>  At the site
>>
>>	http://scikits.com/lookup.html (or
>>  http://zip4.usps.com/zip4/welcome.jsp)
>>
>>  one can enter an address such as 123 Broad St, 95959 and receive a
>>  reply:
>>
>>	123 BROAD ST
>>	NEVADA CITY CA 95959-2623
>>
>>  But the web site that offers this results is listed as:
>>
>>	http://zip4.usps.com/zip4/zip4_responseA.jsp
>>
>>  Needless to say, there is no web site for every address.
>>
>>  So there appears to be no option to simply call up a web site and
>>  parse the results. It seems that the only option would be able to
>>  Write to a web site (at least to site which present this option) as
>>  well as Read from the site. Seems unlikely.
>>
>>  Does Run Rev offer any options in this circumstance?
>>
>
>I'm not sure if I understand what you want to do. You can use the post
>command to use the url described above. This basically emulates the
>form submission of the webpage. (You have to look through the raw
>source of the webpage to find the necessary form field values.) For
>example, the following script uses your example address to put the
>webpage normally returned into field 1.
>
>on mouseUp
>    put empty into field 1
>
>    put "Selection=" & 1 after tQuery
>    put "&" after tQuery
>    put "address1=" & urlEncode("123 BROAD ST") after tQuery
>    put "&" after tQuery
>    put "zipcode=" & 95959 after tQuery
>
>    put  "http://zip4.usps.com/zip4/zip4_responseA.jsp" into tUrl
>
>    post tQuery to url tUrl
>    if the result <> empty then
>      answer the result
>    else
>      set the htmltext of field 1 to  it
>    end if
>
>end mouseUp
>
>
>Cheers
>Dave
>

Dave and Chip,

Well, this opens up a whole new facet of Run. So much to learn.

Thanks again.

Jim


More information about the use-livecode mailing list