You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
309 B
16 lines
309 B
local http=require "socket.http"
|
|
function snarf(s,l)
|
|
local body,code=http.request(s)
|
|
if code<=400 or code>=599 then
|
|
error(code)
|
|
elseif code<=300 or code>=399 then
|
|
print("Redirects not currently implemented")
|
|
error(code)
|
|
end
|
|
|
|
local f=assert(io.open(l))
|
|
f:write(body)
|
|
f:close()
|
|
end
|
|
return snarf
|