Jawaban:
Linux akan sangat membantu di sini:
Buat file skrip bernama fetch_redirects
:
#!/bin/bash
while read url
do
echo -n "$url,"
curl "$url" -s -L -I -o /dev/null -w '%{url_effective}'
done < "${1:-/proc/${$}/fd/0}"
Pastikan untuk menandainya executable
Kemudian, diberi daftar url, satu per baris urls.txt
, jalankan:
cat urls.txt | fetch_redirects > redirects.csv
Anda kemudian dapat membuka redirects.csv
di Excel atau alat lain yang mendukung file CSV.
Function HttpExists(sURL As String) As String Dim oXHTTP As Object Set oXHTTP = CreateObject("MSXML2.XMLHTTP") If Not UCase(sURL) Like "HTTP:*" Then sURL = "http://" & sURL End If On Error GoTo haveError oXHTTP.Open "HEAD", sURL, False oXHTTP.send HttpExists = IIf(oXHTTP.Status = 200, "Page is Live", "redirects or missing") Exit Function haveError: HttpExists = "redirects or missing" End Function
curl $1 -s -L -I -o /dev/null -w '%{url_effective}'