Posted: Sat Jul 16, 2005 4:37 am
Here's the code for the lib:Max. wrote:It is basically what you posted already.TerryHough wrote:Care to share your code?
Code: Select all
; By NoahPhense
; Date: 27. June 2004
; note: Thought I saw something like this somewhere, but couldn't
; find it, so I modified some old code. This code is meant
; to rip pages. So I'm just parsing the ripped page.
;- PROCEDURES
Procedure.s OpenURL(Url.s, OpenType.b)
; OpenURL procedure by ricardo 2003
isLoop.b=1
INET_RELOAD.l=$80000000
hInet.l=0: hURL.l=0: Bytes.l=0
Buffer.s=Space(2048)
hInet = InternetOpen_("PB@INET", OpenType, #NULL, #NULL, 0)
hURL = InternetOpenUrl_(hInet, Url, #NULL, 0, INET_RELOAD, 0)
Repeat
Delay(1)
InternetReadFile_(hURL, @Buffer, Len(Buffer), @Bytes)
If Bytes = 0
isLoop=0
Else
res.s = res + Left(Buffer, Bytes)
EndIf
Until isLoop=0
InternetCloseHandle_(hURL)
InternetCloseHandle_(hInet)
ProcedureReturn res
EndProcedure
ProcedureDLL.s lbdt_GetIP_Ver(); returns a string with the current version
ver.s = "GetIP v1.0 beta"
ProcedureReturn ver
EndProcedure
ProcedureDLL.s lbdt_GetIP_Contact(); returns a contact email address
contact.s = "dev.team@liquidbuzz.com"
ProcedureReturn contact
EndProcedure
;- SITES
ProcedureDLL.s lbdt_GetIP(); returns a string with your external IP Address
site1_rtn.s = "" ; clear for next run
URL$ = "http://www.ipaddressworld.com"
HTML$ = OpenURL(URL$, 1)
q.s = Chr(34)
mainString.s = "<font face="+q+"Verdana, Arial, Helvetica, Sans-serif"+q+" size="+q+"+6"+q+">"
; Debug HTML$
mod_1 = FindString(HTML$, mainString, 1)
mod_2.s = Mid(Html$, mod_1, 100)
mod_4.s = Mid(mod_2, 62, 15)
mod_5 = FindString(mod_4, "<", 1)
mod_6.s = Mid(mod_4, 1, mod_5-1)
For k=1 To 4
lcl.s = StringField(mod_6, k, ".")
If Val(lcl) >= 1
; -- do nothing
Else
site1_rtn = "bad site"
EndIf
Next
If site1_rtn = ""
site1_rtn = mod_6
EndIf
ProcedureReturn site1_rtn
EndProcedure
- np