Geolocation by IP address in Alaska
Posted: Mon Jun 20, 2022 9:46 pm
There is a geolocation service: https://ip-api.com/#71.39.117.6 . How to pull information in curly brackets into a text variable?
Donnay Software Web Forums
http://bb.mobile.donnay-software.com/Donnay/
http://bb.mobile.donnay-software.com/Donnay/viewtopic.php?f=2&t=3037
Code: Select all
nHandle := FCREATE( cFile, FC_NORMAL )
IF nHandle == - 1
MsgInfo( "Error create File : " + cFile, STR( FERROR() ) )
RETURN
ELSE
FWRITE( nHandle, cRun + cPara + cClip)
FCLOSE( nHandle )
ENDIF
System.EmptyClipboard
ShellExecute( 0, "open", cFile,,, SW_HIDE )
DO WHILE EMPTY(System.Clipboard )
hb_idleSleep( 0.1 )
ENDDO
cMemo := System.Clipboard
Auge_Ohr wrote: ↑Mon Jun 20, 2022 11:47 pm hi Eugene,
i have try ">> Logme.TXT" and " | CLIP " but both does not work when call from App ...![]()
so i create a *.BAT and call that *.BATit is HMG Syntax but should be easy to translate to Xbase++Code: Select all
nHandle := FCREATE( cFile, FC_NORMAL ) IF nHandle == - 1 MsgInfo( "Error create File : " + cFile, STR( FERROR() ) ) RETURN ELSE FWRITE( nHandle, cRun + cPara + cClip) FCLOSE( nHandle ) ENDIF System.EmptyClipboard ShellExecute( 0, "open", cFile,,, SW_HIDE ) DO WHILE EMPTY(System.Clipboard ) hb_idleSleep( 0.1 ) ENDDO cMemo := System.Clipboard
this is exact what i doEugene Lutsenko wrote: ↑Tue Jun 21, 2022 1:07 am Hi, Jimmy! I have a problem reading the site into a text variable without opening the browser. The rest is not a problem for me
Code: Select all
PROCEDURE MAIN(cNewIP)
LOCAL cRun := "curl "
LOCAL cPara := "ip-api.com "
LOCAL cClip := " | CLIP "
LOCAL cFile := "GetIP.BAT"
LOCAL cMemo , nHandle
You can do this with LoadFromURL().I have a problem reading the site into a text variable without opening the browser.
When I launch in the browser address bar http://ip-api.com/#71.39.117.6 I get: It suits me fine. But I would like to get the html code drawing this page in the browser. When I try to do this, it turns out that.
Code: Select all
cResponse := LoadFromURL( 'http://ip-api.com/#71.39.117.6' )
MsgBox(cResponse)
Code: Select all
cResponse := LoadFromURL( 'http://ip-api.com/#71.39.117.6' )
MsgBox(cResponse)
cResponse := LoadFromURL( 'http://ip-api.com/json/71.39.117.6' )
MsgBox('json'+', '+cResponse)
cResponse := LoadFromURL( 'http://ip-api.com/xml/71.39.117.6' )
MsgBox('xml'+', '+cResponse)
cResponse := LoadFromURL( 'http://ip-api.com/csv/71.39.117.6' )
MsgBox('csv'+', '+cResponse)
cResponse := LoadFromURL( 'http://ip-api.com/line/71.39.117.6' )
MsgBox('line'+', '+cResponse)
cResponse := LoadFromURL( 'http://ip-api.com/php/71.39.117.6' )
MsgBox('php'+', '+cResponse)