parse an autoindex page into JSON (client or server-side)