Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local filename = args[1] or "urls"
- local working, failed = {}, {}
- local file = io.open(filename, "r")
- for url in file:lines(filename) do
- if url:len() > 3 then
- http.request("https://" .. url)
- local e,u,r = os.pullEvent()
- if e == "http_success" then
- table.insert(working, url)
- elseif e == "http_failure" then
- table.insert(failed, url)
- else
- print("Skipped " .. url)
- end
- end
- end
- file:close()
- local result = io.open("result", "w")
- result:write("Works:\n" .. table.concat(working, "\n"))
- result:write("\n\nFails:\n" .. table.concat(failed, "\n"))
- result:close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement