Can Rev as CGI pull an URL's HTML into a variable?

Dave Cragg dcragg at lacscentre.co.uk
Wed Aug 16 03:34:14 EDT 2006


On 16 Aug 2006, at 04:49, rgould8 at aol.com wrote:

>
> When I run the below script as a CGI, I get, maybe 90% of the html  
> back, but it hangs at the end for some reason.  Is there a  
> character-limit to how much text libURL can retrieve at once?

There's no limit.

As a first step, I'd suggest you retrieve the url before you starting  
sending back any response from your CGI. Something like this (untested):

#!revolution

on startup

  start using stack "liburl_1.1.5_minus.rev"

  put $QUERY_STRING into searchstring
  put "http://www.imdb.com/find?s=tt&q=" & searchstring into searchURL
  put URL searchURL into databack
  if the result <> empty then ##error occurred
   put "error" && the result into databack
  end if

  put "parameter   = " & urlDecode($QUERY_STRING) into tRet
  put cr & "databack = " & databack after tRet

  put "Content-Type: text/plain" & cr
  put "Content-Length:" & length(tRet) & cr & cr

  put tRet

  wait 20 milliseconds ##helps with some servers
  end startup

If this still has problems, let us know.

Cheers
Dave



More information about the use-livecode mailing list