local links = {
}
function explode(div,str)
if (div=='') then return false end
local pos,arr = 0,{}
for st,sp in function() return string.find(str,div,pos,true) end do
table.insert(arr,string.sub(str,pos,st-1))
pos = sp + 1
end
table.insert(arr,string.sub(str,pos))
return arr
end
for i=1,#links do
local a = explode(",",links[i])
if http.checkURL(a[1]) then
local files = http.get(a[1])
local code = files.readAll()
files.close()
local file = fs.open(a[2],"w")
file.write(code)
file.close()
end
end
Comments