Dear friends,
Well, i need please an help with fresh code for a project of mine...
I need to retrieve every second the value of some money pairs...but for example is ok for one...
1) first of all i have registered me to true.fx ...
2) this is a demo url without my registration of course but working... :
http://webrates.truefx.com/rates/connect.html?f=html&c=AUD/USD
this give this result: AUD/USD 1462567500019 0.73667 0.73681 0.73373 0.74784 0.74643
I need to retrieve the last value 0.74643
the first value from right, to work and put it into a variable and update every second
So i don't know if i must get my url and retrieve that data?
..any idea?? thanks a lot in advance
Lestroso :(
Hi There
Yes, you can collect via html using
data$=NETWEBGET$("www.sitename.com","/pagename.html",80,512,5000)
Then parse it using split function like so...
LOCAL splits$[]
num = SPLITSTR(data$, splits$[], " ") // using space as delimiter
IF num>0
FOR i=0 TO num-1
PRINT ""+splits$[i]+"", 70, 100+(20*(i+1))
NEXT
ELSE
PRINT "No Connection", 70, 120
ENDIF
ENDIF
hI.... I have tryed your software ...but don't work...can you help me?? please??? i have write this...:
// --------------------------------- //
// Project: VALORI
// Start: Monday, May 09, 2016
// IDE Version: 14.106
// SETCURRENTDIR("Media") // go to media files
data$=NETWEBGET$("http://webrates.truefx.com","/rates/connect.html?f=html&c=AUD/USD",80,512,5000)
LOCAL splits$[]
num = SPLITSTR(data$, splits$[], " ") // using space as delimiter
IF num>0
FOR i=0 TO num-1
PRINT ""+splits$[i]+"", 70, 100+(20*(i+1))
NEXT
ELSE
PRINT "No Connection", 70, 120
ENDIF
ENDIF
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:9655d67f - 3D, NET
"VALORI.gbas"(25) error : GPC000d ENDIF without IF
If i delete the last endif give this...
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:9655d67f - 3D, NET
"VALORI.gbas"(10) error : GPC1002 variable is not explicitly defined : data$
Can you help help me?
LESTROSO
you have to declare data$ as global. You can switch this in the options off but i don't recommend this.
GLOBAL data$=NETWEBGET$("http://webrates.truefx.com","/rates/connect.html?f=html&c=AUD/USD",80,512,5000)
The last ENDIF is wrong.
Nothing works here...:
i have added some code but nothing.....i see nothing... did you try it??
// --------------------------------- //
// Project: VALORI
// Start: Monday, May 09, 2016
// IDE Version: 14.106
// SETCURRENTDIR("Media") // go to media files
GLOBAL data$=NETWEBGET$("http://webrates.truefx.com/rates/connect.html?f=html&c=AUD/USD",80,512,5000)
LOCAL splits$[]
LOCAL num = SPLITSTR(data$, splits$[], " ") // using space as delimiter
IF num>0
FOR i=0 TO num-1
PRINT ""+splits$[i]+"", 70, 100+(20*(i+1))
NEXT
ELSE
PRINT "No Connection", 70, 120
ENDIF
MOUSEWAIT
Remove http:// and add SHOWSCREEN before MOUSEWAIT
Thanks a lot!! now it works fine...Best Regards, Lestroso...
// --------------------------------- //
// Project: VALORI
// Start: Monday, May 09, 2016
// IDE Version: 14.106
// SETCURRENTDIR("Media") // go to media files
GLOBAL data$=NETWEBGET$("webrates.truefx.com","/rates/connect.html?f=html&c=AUD/USD",80,512,5000)
LOCAL splits$[]
LOCAL num = SPLITSTR(data$, splits$[], " ") // using space as delimiter
IF num>0
FOR i=0 TO num-1
PRINT ""+splits$[i]+"", 70, 100+(20*(i+1))
NEXT
ELSE
PRINT "No Connection", 70, 120
ENDIF
SHOWSCREEN
MOUSEWAIT
Also the biggest issue with NETWEBGET, is NETWEBGET should been done in a thread, newer in the main thread. This is something that should have been in a background aktivity. Hopefuly that can been fixed in the future.
You can use sock... to asynchronically get bits..
or http://www.glbasic.com/forum/index.php?topic=3642.0