const axios = require("axios"); const cheerio = require("cheerio"); const links = [ "https://balenotown.com/", "https://pulosari-jombang.web.id/", "https://ppid.kemenpppa.id/", "https://ejer.com.tr/", "https://redepp.ufv.br/", "https://vra.unap.edu.pe/", "https://simanila.unila.ac.id/", "https://elsa.org/", "https://kbps.kerala.gov.in/", "https://e.gsstore.org/", "https://kabkediri.com/", ]; async function fetchMetadata(url) { try { const response = await axios.get(url, { headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36", }, timeout: 10000, }); const html = response.data; const $ = cheerio.load(html); const title = $("title").text().trim() || "No title"; const description = $('meta[name="description"]').attr("content")?.trim() || "No description"; console.log("================================"); console.log("URL:", url); console.log("Title:", title); console.log("Description:", description); } catch (error) { console.warn(`Gagal ambil ${url}: ${error.message}`); } } (async () => { for (const url of links) { await fetchMetadata(url); } })();