RosettaCodeData/Task/HTTP/PureBasic/http-1.purebasic

18 lines
408 B
Plaintext

InitNetwork()
OpenConsole()
tmpdir$ = GetTemporaryDirectory()
filename$ = tmpdir$ + "PB_tempfile" + Str(Random(200000)) + ".html"
If ReceiveHTTPFile("http://rosettacode.org/wiki/Main_Page", filename$)
If ReadFile(1, filename$)
Repeat
PrintN(ReadString(1))
Until Eof(1)
Input()
; to prevent console from closing if on windows
CloseFile(1)
EndIf
DeleteFile(filename$)
EndIf