async function searchResults(keyword) { try { const encodedKeyword = encodeURIComponent(keyword); const url = `https://chireads.com/search?x=0&y=0&name=${encodedKeyword}`; const response = await soraFetch(url); const html = await response.text(); const results = []; const liRegex = /
  • ([\s\S]*?)<\/li>/g; let liMatch; while ((liMatch = liRegex.exec(html)) !== null) { const liHtml = liMatch[1]; const linkMatch = liHtml.match(/
    [\s\S]*?[\s\S]*?[\s\S]*?]+>([^<]+)<\/a>/); if (linkMatch && imgMatch && titleMatch) { let image = imgMatch[1]; if (!image.startsWith("http")) image = "https:" + image; results.push({ title: decodeHtmlEntities(titleMatch[1].trim()), href: linkMatch[1].trim(), image: image.trim() }); } } console.log(JSON.stringify(results)); return JSON.stringify(results); } catch (error) { console.error("Error fetching or parsing: " + error); return JSON.stringify([{ title: "Error", href: "", image: "" }]); } } async function extractDetails(url) { try { const response = await soraFetch(url); const htmlText = await response.text(); const descMatch = htmlText.match(/
    \s*([\s\S]*?)<\/span>\s*<\/div>/i); let description = descMatch ? descMatch[1] .replace(//gi, '\n') .replace(/\s+/g, ' ') .trim() : "No description available"; const aliases = 'N/A'; const airdate = 'N/A'; const transformedResults = [{ description, aliases, airdate }]; console.log(JSON.stringify(transformedResults)); return JSON.stringify(transformedResults); } catch (error) { console.log('Details error:' + error); return JSON.stringify([{ description: 'Error loading description', aliases: 'N/A', airdate: 'N/A' }]); } } async function extractChapters(url) { try { const response = await soraFetch(url); const htmlText = await response.text(); let contentHtml = null; const ulPattern = /