Getting url

Jim Ault jimaultwins at yahoo.com
Wed Nov 18 11:44:17 EST 2009


On Nov 17, 2009, at 11:05 PM, Bill Marriott wrote:

> Google is detecting the "browser" you're using and formatting the  
> results differently.
>
> The default User Agent String for Rev is something like  
> "Revolution(Win32)." Use the httpHeaders command to set one that  
> resembles your desired browser. e.g.:
>
> Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
>
> The resulting HTML code should then match.
>


Hey, Jim, here are some Rev code lines that do a few things with the  
HTTP headers
(think of the headers as parameters that are passed to the web server  
to change how it performs, just like a function in Rev)

on testHttpHeaders
   get url "http://www.google.com/search?q=10187%20Grinding%20Rock%20Dr%09Grass%20Valley,%20CA%2095945 
  "
   put libURLLastHTTPHeaders() into revHeadersToAnalyze
   put revHeadersToAnalyze into msg -- so you can read what Rev sent
end testHttpHeaders

answer is... the following 3 lines
     GET /search?q=10187%20Grinding%20Rock%20Dr%09Grass%20Valley,%20CA 
%2095945 HTTP/1.1
     Host: www.google.com
     User-Agent: Revolution (MacOS)
----
Using the LiveHeaders add-on tool in Firefox 3 on Mac OSX shows the  
following User-Agent header variable

    User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US;  
rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 GTB6 FirePHP/0.3
----
thus for me the Rev code would be
on testHttpHeaders
    get "User-Agent:"
    get it && "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5;"
    get it && "en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 GTB6  
FirePHP/0.3"
    set the httpHeaders to IT
    get url "http://www.google.com/search?q=10187%20Grinding%20Rock%20Dr%09Grass%20Valley,%20CA%2095945 
  "
    put IT into msg
end testHttpHeaders

Hope this helps.

Jim Ault
Las Vegas


On Nov 17, 2009, at 11:05 PM, Bill Marriott wrote:

> Google is detecting the "browser" you're using and formatting the  
> results differently.
>
> The default User Agent String for Rev is something like  
> "Revolution(Win32)." Use the httpHeaders command to set one that  
> resembles your desired browser. e.g.:
>
> Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
>
> The resulting HTML code should then match.
>
> "James Hurley" <jhurley0305 at sbcglobal.net> wrote in message news:097C4FD2-75DA-40C9-AB0A-CDFC8E1682FC at sbcglobal.net 
> ...
>> I am trying to do address verification.
>>
>> For example, the county DB lists the following two address
>>
>> 10187 Grinding Rock Dr [tab] Grass Valley CA 95945
>> and also
>> 10187 Grinding Rock Dr [tab] Grass Valley CA 95949
>>
>> I want to find out (programatically) if the zip should be 95945 or  
>> 95949
>>
>> So here is my dillema:
>>
>> When I do a Google search for the 95945 zip code address I get a  
>> page that tells me that the zip code should be 95949
>>
>> When I compare the source code of this page with the RunRev result   
>> from the following:
>>
>> get url "http://www.google.com/search?q=10187%20Grinding%20Rock%20Dr%09Grass%20Valley,%20CA%2095945 
>>  "
>>
>> The value of "it" is not the same as the source code of the Google   
>> search page. Not even close.
>>
>> What am I missing?
>>
>> Jim Hurley
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Jim Ault
jimaultwins at yahoo.com






More information about the use-livecode mailing list