Getting url

James Hurley jhurley0305 at sbcglobal.net
Wed Nov 18 15:36:03 EST 2009


Thanks Bill and Jim. Very helpful.

Jim Hurley

>
> ------------------------------
>
> Message: 17
> Date: Wed, 18 Nov 2009 02:05:56 -0500
> From: "Bill Marriott" <wjm at wjm.org>
> Subject: Re: Getting url
> To: use-revolution at lists.runrev.com
> Message-ID: <he0qo9$f51$1 at ger.gmane.org>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
> 	reply-type=response
>
> 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.

>
> Message: 25
> Date: Wed, 18 Nov 2009 08:44:17 -0800
> From: Jim Ault <jimaultwins at yahoo.com>
> Subject: Re: Getting url
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <86465AC0-8AF6-4B93-86D6-9BB148094FED at yahoo.com>
> Content-Type: text/plain;	charset=US-ASCII;	format=flowed;	delsp=yes
>
>
>
> 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
>





More information about the use-livecode mailing list