Page 5 of 5

Re: Download file from WWW

Posted: Fri Mar 17, 2017 7:54 am
by serge_girard
Hi,

Problem of course is when they change layout of pages !

Serge

Re: Download file from WWW

Posted: Fri Mar 17, 2017 7:59 am
by edk
RPC wrote: Thu Mar 16, 2017 8:38 pm (...)
Could you tell me what should I read on the internet, perhaps a quick tutorial on "querying", which would teach me. :?:
If it is handy, could you please point out to some links. :idea:

I always use the help of Uncle Google ;)

Re: Download file from WWW

Posted: Fri Mar 17, 2017 7:59 am
by edk
serge_girard wrote: Fri Mar 17, 2017 7:54 am Hi,

Problem of course is when they change layout of pages !

Serge
+1
The solution may be webApi, if it exists.

Re: Download file from WWW

Posted: Fri Mar 17, 2017 7:06 pm
by RPC
Hi Edward,
I tried google but could not find the specific information on querying.
I will keep trying though, thanks.
One last thing. How can we check if we are connected to internet or not. In method 2 you have following code
// Connect to the HTTPs server
IF ! oHttp2:open( url+cGet )
msgbox( "Connection error:"+oHttp2:lastErrorMessage())
Return
ENDIF
but the above message is not displayed when I switched my internet off.
Can you pls tell how can we check if we are connected or not.
Many thanks

Re: Download file from WWW

Posted: Fri Mar 17, 2017 9:57 pm
by edk
Queries depend on how the system is built on the side of the host. If the publisher does not provide documentation for general queries, please consult the source code html and see how they are called queries from the website.
Maybe it will be a little helpful: https://perishablepress.com/how-to-writ ... arameters/

To checking your Internet connection, try to use this function:

Code: Select all

IF !isInternet()
	MsgStop("No Internet connection")
	Return
ENDIF
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTION isInternet( nTimeOut )
	Local aAddr:=hb_socketResolveINetAddr( "www.google.com" , 80 )
	Local socket:=hb_socketOpen()
	Local lIsNet
	Default nTimeOut:=2000
	lIsNet:=!EMPTY( aAddr ) .AND. hb_socketConnect( socket , aAddr, nTimeOut )
	hb_socketClose( socket )
RETURN lIsNet
Of course, this will work properly until google.com is alive. :lol:

I know from experience that hbTip may have some bugs, and sometimes did not work as we expect. ;)

Re: Download file from WWW

Posted: Sat Mar 18, 2017 7:42 pm
by RPC
Hi Edward,
Thanks for the code for checking internet connection. Its working :)
Also many thanks for the link where I can learn about querying. Looks like exhaustive information.
I can't thank you enough for being so patient in teaching and explaining me all the intricacies of downloading from internet.
Many thanks for everything. :D
RPC

Re: Download file from WWW

Posted: Sun Mar 19, 2017 8:21 am
by mol
Hi Edward!
Maybe you know, how to detect proxy server?
Your samples and help are very good :)

Re: Download file from WWW

Posted: Sun Mar 19, 2017 10:15 am
by edk
I'm sorry Marek, but I did not need to use a proxy and do not have a ready solution for you.
So I quickly found on the description in C.
http://stackoverflow.com/questions/2025 ... y-settings
and from msdn
https://msdn.microsoft.com/pl-pl/librar ... s.85).aspx
I don't now how to check it out, because I'm with my kid in the clinic for a few days.
Regards, Edward.

Re: Download file from WWW

Posted: Sun Mar 19, 2017 10:45 am
by mol
Something wrong?
dużo zdrowia!

Re: Download file from WWW

Posted: Tue Mar 21, 2017 1:34 pm
by edk
mol wrote: Sun Mar 19, 2017 8:21 am Hi Edward!
Maybe you know, how to detect proxy server?
Your samples and help are very good :)
This may be helpful:
https://github.com/vszakats/harbour-cor ... _proxy.prg
https://github.com/vszakats/harbour-cor ... n_proxyc.c
https://github.com/vszakats/harbour-cor ... /proxy.prg

Edward.