import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./got-BBDj7u1e.mjs";import{r as n,t as r}from"./utils-Bn_I3Ssm.mjs";import i from"dayjs";const a={path:`/search/:keyword`,categories:[`social-media`],example:`/plurk/search/FGO`,parameters:{keyword:`Search keyword`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`Search`,maintainers:[`TonyRL`],handler:o};async function o(a){let o=a.req.param(`keyword`),{data:s}=await t.post(`${r}/Search/search2`,{searchParams:{query:o,start_date:i().subtract(1,`year`).format(`YYYY/MM`),end_date:i().format(`YYYY/MM`)}}),c=s.users,l=s.plurks,u=await Promise.all(l.map(t=>n(`plurk:${t.plurk_id}`,t,c[t.user_id].display_name,e.tryGet)));return{title:`Search "${o}" - Plurk`,description:`Search messages on Plurk`,image:`https://s.plurk.com/e8266f512246cdbc2721.jpg`,link:`${r}/search?q=${encodeURIComponent(o)}`,item:u}}export{a as route};