← back to Dw Sarah Rowland Searchfix
verify-imgs.mjs
12 lines
import fs from 'node:fs';
const rows=fs.readFileSync(new URL('./designers.tsv',import.meta.url),'utf8').trim().split('\n').map(l=>l.split('\t'));
for(const [name,type,path] of rows){
const url='https://koroseal.com'+path;
try{
const r=await fetch(url,{headers:{'User-Agent':'Mozilla/5.0'}});
const ct=r.headers.get('content-type')||'';
const ok=r.ok && /image\//.test(ct);
console.log(`${ok?'✓':'✗'} ${name.padEnd(22)} ${String(r.status).padEnd(4)} ${ct.split(';')[0].padEnd(12)} ${type}`);
}catch(e){ console.log(`✗ ${name.padEnd(22)} ERR ${e.message}`); }
}