Skip to content

Instantly share code, notes, and snippets.

@groverburger
Last active December 28, 2020 04:14
Show Gist options
  • Save groverburger/8e0d812ca99211ab61a1b8ae506fc99f to your computer and use it in GitHub Desktop.
Save groverburger/8e0d812ca99211ab61a1b8ae506fc99f to your computer and use it in GitHub Desktop.
return function (address)
local query = nil
-- check if windows or not windows
if package.config:sub(1,1) == "\\" then
-- TODO fix the annoying cmd window that pops up here
query = io.popen("powershell (wget " .. address .. ").Content", "r")
else
-- not windows, assuming posix
query = io.popen("curl -s '" .. address .. "'", "r")
end
local httpsResult = query:read("*all")
query:close()
return httpsResult
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment