import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{Fragment as t,jsx as n,jsxs as r}from"hono/jsx/jsx-runtime";import{load as i}from"cheerio";import{renderToString as a}from"hono/jsx/dom/server";const o=({images:e,stargazersCount:i,language:o,description:s})=>a(r(t,{children:[e?.length?e.map(e=>e?.src?n(`figure`,{children:n(`img`,{src:e.src,alt:e.alt})},e.src):null):null,i?n(`table`,{children:r(`tbody`,{children:[i?r(`tr`,{children:[n(`th`,{children:`Stars`}),n(`td`,{children:i})]}):null,o?r(`tr`,{children:[n(`th`,{children:`Language`}),n(`td`,{children:o})]}):null,s?r(`tr`,{children:[n(`th`,{children:`Description`}),n(`td`,{children:s})]}):null]})}):null]})),s=async t=>{let{category:n=`repositories`}=t.req.param(),r=Number.parseInt(t.req.query(`limit`)??`100`,10),a=`https://gitstar-ranking.com`,s=new URL(n,a).href,c=i(await e(s)),l=c(`html`).attr(`lang`)??`en`,u=c(`a.list-group-item`).slice(0,r).toArray().map(e=>{let t=c(e),n=Number(t.find(`span.stargazers_count`).text()?.trim()),r=t.find(`span.hidden-xs`).text()?.trim(),i=t.find(`img.avatar_image_big`).attr(`src`),s=t.find(`div.repo-language`).text()?.trim(),l=o({images:i?[{src:i,alt:r}]:void 0,stargazersCount:n,language:s,description:t.find(`div.repo-description`).text()?.trim()}),u=t.attr(`href`),d=s?[s]:[],f=`gitstar-ranking-${r}-${n}`;return{title:`${r} ⭐${n}`,description:l,link:u?new URL(u,a).href:void 0,category:d,guid:f,id:f,content:{html:l,text:l},image:i,banner:i,language:s}}),d=c(`title`).text();return{title:d,description:d.split(/-/)[0],link:s,item:u,allowEmpty:!0,author:d.split(/-/).pop()?.trim(),language:l,id:c(`meta[property="og:url"]`).attr(`content`)}},c={path:`/:category?`,name:`Ranking`,url:`gitstar-ranking.com`,maintainers:[`nczitzk`],handler:s,example:`/gitstar-ranking/repositories`,parameters:{category:{description:`Category, Repositories by default`,options:[{label:`Users`,value:`users`},{label:`Organizations`,value:`organizations`},{label:`Repositories`,value:`repositories`}]}},description:`::: tip
To subscribe to [Repositories](https://gitstar-ranking.com/repositories), where the source URL is \`https://gitstar-ranking.com/repositories\`, extract the certain parts from this URL to be used as parameters, resulting in the route as [\`/gitstar-ranking/repositories\`](https://rsshub.app/gitstar-ranking/repositories).
:::

| Category                                                   | ID                                                                |
| ---------------------------------------------------------- | ----------------------------------------------------------------- |
| [Users](https://gitstar-ranking.com/users)                 | [users](https://rsshub.app/gitstar-ranking/users)                 |
| [Organizations](https://gitstar-ranking.com/organizations) | [organizations](https://rsshub.app/gitstar-ranking/organizations) |
| [Repositories](https://gitstar-ranking.com/repositories)   | [repositories](https://rsshub.app/gitstar-ranking/repositories)   |
`,categories:[`programming`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`gitstar-ranking.com/:category`],target:`/:category`},{title:`Users`,source:[`gitstar-ranking.com/users`],target:`/users`},{title:`Organizations`,source:[`gitstar-ranking.com/organizations`],target:`/organizations`},{title:`Repositories`,source:[`gitstar-ranking.com/repositories`],target:`/repositories`}],view:0};export{s as handler,c as route};