Task

Access and print a URL's content (the located resource) to the console.

There is a separate task for HTTPS Requests.




 
 
DLL "<urlmon.dll>"
 INTEGER PROC FNUrlGetSourceApiI(
  INTEGER lpunknown,
  STRING urlS : CSTRVAL,
  STRING filenameS : CSTRVAL,
  INTEGER dword,
  INTEGER tlpbindstatuscallback
) : "URLDownloadToFileA"
END
 
// library: url: get: source <description></description> <version control></version control> <version>1.0.0.0.3</version> (filenamemacro=geturgso.s) [kn, ri, su, 13-04-2008 05:12:53]
PROC PROCUrlGetSource( STRING urlS, STRING filenameS )
 FNUrlGetSourceApiI( 0, urlS, filenameS, 0, 0 )
END
 
PROC Main()
STRING s1[255] = "http://www.google.com/index.html"
STRING s2[255] = "c:\temp\ddd.txt"
IF ( NOT ( Ask( "url: get: source: urlS = ", s1, _EDIT_HISTORY_ ) ) AND ( Length( s1 ) > 0 ) ) RETURN() ENDIF
IF ( NOT ( AskFilename( "url: get: source: filenameS = ", s2, _DEFAULT_, _EDIT_HISTORY_ ) ) AND ( Length( s2 ) > 0 ) ) RETURN() ENDIF
 PROCUrlGetSource( s1, s2 )
 EditFile( s2 )
END
 
 