View difference between Paste ID: cqEqpsqW and k9W3zP2F
SHOW: | | - or go back to the newest paste.
1
local args = {...}
2
local filename = args[1] or "urls"
3
4
local working, failed = {}, {}
5
6
local file = io.open(filename, "r")
7
for url in file:lines(filename) do
8
  if url:len() > 3 then
9
    http.request("https://" .. url)
10
    local e,u,r = os.pullEvent()
11
    if e == "http_success" then
12
      table.insert(working, url)
13
    elseif e == "http_failure" then
14
      table.insert(failed, url)
15
    else
16
      print("Skipped " .. url)
17
    end
18
  end
19
end
20
file:close()
21
22
local result = io.open("result", "w")
23
result:write("Works:\n" .. table.concat(working, "\n"))
24
result:write("\n\nFails:\n" .. table.concat(failed, "\n"))
25
result:close()