import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{i as r,n as i,r as a,t as o}from"./utils-BqijXd_m.mjs";import{load as s}from"cheerio";const c={path:`/review/:keyword?`,categories:[`new-media`],example:`/techpowerup/review/amd`,parameters:{keyword:`Search Keyword`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`techpowerup.com/review/search`,`techpowerup.com/review`],target:``}],name:`Reviews`,maintainers:[`TonyRL`],handler:l,url:`www.techpowerup.com/review/`};async function l(c){let l=c.req.param(`keyword`),u=new URL(`${o}/review/${l?`search/`:``}`);l&&(u.searchParams.set(`q`,l),u.searchParams.set(`_`,Date.now().toString()));let d=s(await e(u.href,{headers:a})),f=d(`.reviewlist-bit`).toArray().map(e=>{let t=d(e),r=t.find(`.title a`);return{title:r.text(),link:o+r.attr(`href`),pubDate:n(t.find(`.date time`).attr(`datetime`)),author:t.find(`.author`).contents().filter((e,t)=>t.type===`text`).text().trim(),category:t.find(`.category`).contents().filter((e,t)=>t.type===`text`).text().trim()}}),p=await Promise.all(f.map(n=>t.tryGet(n.link,async()=>{let t=s(await e(n.link,{headers:a}));return i(t),await r(t,n),n})));return{title:`Reviews | TechPowerUp`,link:u.href,language:`en`,image:`https://tpucdn.com/apple-touch-icon-v1684568903519.png`,item:p}}export{c as route};