Re: HTML question

new topic     » goto parent     » topic index » view thread      » older message » newer message

Here is the procedure to call the web pageThis is some code part of which is
from eutcp
===================================

procedure onClick_GoButton(atom id, atom event, sequence params)
integer urlLength, htmlfilelength
sequence URLtext, htmltext, htmlfile, htmldef, line_return, wwwperiod,
wwwdef
htmldef = ".html"
wwwdef = "www."
line_return = "\n"
proxy = ""       -- if you have no proxy
--proxy = "209.249.147.13:8080" -- proxy details here if you use one
remote_file =
"http://webservices.pcquote.com/cgi-bin/excelget.exe?TICKER='KKD'" --&
stockID
local_file = "yahoo.html"
puts(1,remote_file &"\n")
--trace(3)
-- show a little intro
setText(RE,"Download Web File Demo\n")
-- initiaise tcp4u
if tcp4u_init() != TCP4U_SUCCESS then
   wait_abort("tcp4u_init error")
end if
-- these are the defaults but included for testing
http4u_set_buffer_size(4096)
http4u_set_timeout(60)
-- get the file
setText(RE, ("...downloading file \nfrom '%s'" )) --, \nto '%s' \nusing
proxy '%s'\n",))
--  ({remote_file, local_file, proxy}) )
URLtext = getText(URLBox)
urlLength = length(URLtext)
if urlLength < 8 then
 setText(errBox, "too short URL")
return
end if

setText(errBox, URLtext )
htmlfile = URLtext[7..urlLength]
htmlfilelength = length(htmlfile)
wwwperiod = htmlfile[1..4]
if compare(wwwperiod, wwwdef) then
 htmlfile = htmlfile[5..htmlfilelength]
 end if
--htmltext = line[1..length(URLBox)]
htmlfile = lTrim(htmlfile)
setText(RE, htmlfile & line_return )
htmlfile = (htmlfile & htmldef)
setText(RE, htmlfile & line_return )
htmlfile = "c:\\euphoria\\demo\\eutcp\\ down.html" --& htmlfile
setText(RE, htmlfile & line_return )

return_code = http4u_get_file(URLtext, NULL,
"c:\\euphoria\\demo\\eutcp\\rapideuphoria.html")
   setText(RE,"Error downloading file '%s'\n") --,
({http4u_error_string(return_code)}) )
setText(RE, return_code & line_return )
if return_code = HTTP4U_SUCCESS then
   setText(RE, "...file downloaded successfully\n")
else
   setText(RE, "Error downloading file '%s'\n") --,
{http4u_error_string(ret)} )
end if

end procedure

----- Original Message ----- 
From: <rml at rubis.trix.net>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, September 28, 2003 6:18 PM
Subject: Re: HTML question


>
>
> Hi Jim;
>
> How did you submit the line using euphoria ?
> Send the code so we can see what's going wrong.
>
>
> Rubens
>
> At 19:38 28/9/2003, you wrote:
>
> >When I put the line in Windows Explorer I get the page.
> >When I have this line submitted in a Euphoria program it tells me I can't
> >find the page.Should I have a special charcter or ?
> >The last field I have defined asobject, sequence.
> >JIM
> >
>
><http://webservices.pcquote.com/cgi-bin/excelget.exe?TICKER=KKD>http://webs
ervices.pcquote.com/cgi-bin/excelget.exe?TICKER=KKD
> >
> >
> >TOPICA - Start your own email discussion group. FREE!
>
> --^----------------------------------------------------------------
> This email was sent to: sixs at ida.net
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu