GSAK (Geocaching Swiss Army Knife)
GetUrl(sUrl,[sCaption],[nTimeout]) : string
Retrieve the contents of any URL to a variable
sUrl - The Url to get
sCaption - Optional, default is "". Set to a non empty value to show a dialog with the percentage status of the download, and this caption in the title bar. Useful when downloading large files. Set to "" or leave out this parameter when downloading small files or web pages and you don't need this status.
Note1: Not all Urls return the size of the contents being downloaded so the percentage may not change.
Note2: The special caption "AddHeader:" can be used to add headers to the URL. For more information see this link
Note3: If the Url is a file download (especially a large file) then in the caption use <filename:OutputFileName> where "OutputFileName" is the fully qualified file name where the data will be saved. For more information see this link.
nTimeout - Optional, default is 30. The number of seconds to wait before the terminating (because of no response from the server)
For example, to get the raw HTML code for the main page of the GSAK web site:
To download (showing progress status) and save a file (the example if one of the GSAK patches):
To download (showing progress) a static image of a Google Map for the current cache (more information on static maps)
 Please read the Google TOU to determine if your intended use of the resulting images from this type of code is acceptable
Alpha List Category List
Copyright 2004-2013 CWE Computer Services |