Returns the source of a URL (or the combined source of multiple URLs) as a string without the overhead of a browser.
OS version: OS X
set the_URL to "http://www.macscripter.net" --single URL string or list of URL strings
return get_URL_source(the_URL)
on get_URL_source(the_URL)
if class of the_URL = string then
set the_script to "cURL " & (quoted form of the_URL)
else if class of the_URL = list then
set the_script to "cURL "
repeat with i from 1 to count of the_URL
if class of (item i of the_URL) = string then
set the_script to the_script & " " & (quoted form of (item i of the_URL))
else
return "error: the submitted parameter is not a string or list of strings."
end if
end repeat
else
return "error: the submitted parameter is not a string or list of strings."
end if
return do shell script the_script
end get_URL_source