import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./got-BBDj7u1e.mjs";import{load as n}from"cheerio";const r={path:`/topics/:name/:qs?`,categories:[`programming`],example:`/github/topics/framework`,parameters:{name:`Topic name, which can be found in the URL of the corresponding [Topics Page](https://github.com/topics/framework)`,qs:"Query string, like `l=php&o=desc&s=stars`. Details listed as follows:"},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`github.com/topics`]}],name:`Topics`,maintainers:[`queensferryme`],handler:i,url:`github.com/topics`,description:"| Parameter | Description      | Values                                                                                                                          |\n| --------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| `l`       | Language         | For instance `php`, which can be found in the URL of the corresponding [Topics page](https://github.com/topics/framework?l=php) |\n| `o`       | Sorting Order    | `asc`, `desc`                                                                                                                   |\n| `s`       | Sorting Criteria | `stars`, `forks`, `updated`                                                                                                     |\n\n  For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will generate the RSS feed corresponding to this [page](https://github.com/topics/framework?l=php&o=desc&s=stars)."};async function i(r){let{data:i,url:a}=await t(`https://github.com/topics/${r.req.param(`name`)}`,{searchParams:new URLSearchParams(r.req.param(`qs`))}),o=n(i);return{title:o(`title`).text(),description:o(`.markdown-body`).text().trim(),link:a,item:o(`article.border`).toArray().map(t=>{t=o(t);let n=t.find(`h3`).text().trim();return{title:n,author:n.split(`/`)[0],description:(t.find(`a img`).prop(`outerHTML`)??``)+t.find(`div > div > p`).text(),link:`https://github.com${t.find(`h3 a`).last().attr(`href`)}`,category:t.find(`.topic-tag`).toArray().map(e=>o(e).text().trim()),pubDate:e(t.find(`relative-time`).attr(`datetime`))}})}}export{r as route};