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

Andre Garzia soapdog at mac.com
Wed Aug 16 14:36:52 EDT 2006


Mark,

thanks, it's -s just tried it out... it works like a charm, no need  
for libURL.

Andre

On Aug 16, 2006, at 3:26 PM, Mark Smith wrote:

> I can't remember what it is, but there's a -v or -s or something  
> you can put in curl string to stop it doing that...
>
> Mark
>
> On 16 Aug 2006, at 19:17, Andre Garzia wrote:
>
>> Rob,
>>
>> try:
>>
>> pput $QUERY_STRING into searchstring
>>>>   put "http://www.imdb.com/find?s=tt&q=" & searchstring into  
>>>> searchURL
>>>>   put shell("curl" && searchURL) into databack
>>
>> beware that curl will put more data in the answer such as transfer  
>> time. You'll need to use lineoffset to find where to start.
>>
>> Andre
>>
>>
>> On Aug 16, 2006, at 2:54 PM, RGould8 at aol.com wrote:
>>
>>> Hmmm, I'm afraid I'm having the same problem, using the script  
>>> you provided.
>>>  I do get 90% of the html, but the loading process just hangs.
>>>
>>> Server:   Mac OS X Tiger 10.4
>>> Client:   Safari or Firefox
>>>
>>> Could it be something with Mac OS X?
>>>
>>>
>>> In a message dated 8/16/06 3:34:31 AM, dcragg at lacscentre.co.uk  
>>> writes:
>>>
>>>
>>>>
>>>> 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
>>>> _______________________________________________
>>>> 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
>>
>> _______________________________________________
>> 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




More information about the use-livecode mailing list