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{Fragment as r,jsx as i,jsxs as a}from"hono/jsx/jsx-runtime";import{load as o}from"cheerio";import{renderToString as s}from"hono/jsx/dom/server";import{raw as c}from"hono/html";const l=({images:e,intro:t,description:n})=>s(a(r,{children:[e?.map(e=>e?.src?i(`figure`,{children:i(`img`,{src:e.src,alt:e.alt??void 0})}):null),t?i(`blockquote`,{children:t}):null,n?i(r,{children:c(n)}):null]})),u=async r=>{let{topic:i}=r.req.param(),a=Number.parseInt(r.req.query(`limit`)??`10`,10),s=`https://www.pixelstech.net`,c=new URL(`feed/${i??``}`,s).href,u=o(await e(c)),d=u(`html`).attr(`lang`)??`en`,f=u(`div.feed-item`).slice(0,a).toArray().map(e=>{let t=u(e),r=t.find(`a.feed-item-link`),i=r.text(),a=t.attr(`data-bg-image`),o=l({images:a?[{src:a,alt:i}]:void 0,intro:t.find(`div.feed-item-description`).text()}),c=t.parent().find(`h2.section-heading`).text(),f=r.attr(`href`),p=t.attr(`data-feed-id`)?`pixelstech-feed#${t.attr(`data-feed-id`)}`:``,m=t.find(`.time`).text()||c;return{title:i,description:o,pubDate:c?n(c):void 0,link:f?new URL(f,s).href:void 0,guid:p,id:p,content:{html:o,text:o},image:a,banner:a,updated:m?n(m):void 0,language:d}});return f=await Promise.all(f.map(n=>n.link?t.tryGet(n.link,async()=>{try{let t=o(await e(n.link));t(`div.login-prompt`).remove();let r=t(`h1`).text(),i=(n.description??``)+l({description:t(`article.content-article`).html()??void 0}),a={title:r,description:i,link:t(`span.source-text a`).attr(`href`)??n.link,content:{html:i,text:i},language:d};return{...n,...a}}catch{return n}}):n)),{title:u(`title`).text(),description:u(`meta[name="description"]`).attr(`content`),link:c,item:f,allowEmpty:!0,image:u(`meta[name="twitter:image"]`).attr(`content`),author:u(`meta[name="author"]`).attr(`content`),language:d,id:u(`meta[property="og:url"]`).attr(`content`)}},d={path:`/feed/:topic?`,name:`Feed`,url:`www.pixelstech.net`,maintainers:[`nczitzk`],handler:u,example:`/pixelstech/feed/ai`,parameters:{category:{description:`Topic, all by default`,options:[{label:`All`,value:``},{label:`AI`,value:`ai`},{label:`Alibaba`,value:`alibaba`},{label:`Apple`,value:`apple`},{label:`Database`,value:`database`},{label:`Go`,value:`go`},{label:`Huawei`,value:`huawei`},{label:`Java`,value:`java`},{label:`JavaScript`,value:`javascript`},{label:`Linux`,value:`linux`},{label:`LLM`,value:`llm`},{label:`Nvidia`,value:`nvidia`},{label:`Python`,value:`python`},{label:`Rust`,value:`rust`},{label:`Tesla`,value:`tesla`},{label:`Web`,value:`web`},{label:`Web3`,value:`web3`},{label:`Zig`,value:`zig`}]}},description:`:::tip
To subscribe to [AI](https://www.pixelstech.net/feed/ai), where the source URL is \`https://www.pixelstech.net/feed/ai\`, extract the certain parts from this URL to be used as parameters, resulting in the route as [\`/pixelstech/feed/ai\`](https://rsshub.app/pixelstech/feed/ai).
:::

<details>
  <summary>More topics</summary>

  | Topic                                                    | ID                                                          |
  | -------------------------------------------------------- | ----------------------------------------------------------- |
  | [AI](https://www.pixelstech.net/feed/ai)                 | [ai](https://rsshub.app/pixelstech/feed/ai)                 |
  | [Alibaba](https://www.pixelstech.net/feed/alibaba)       | [alibaba](https://rsshub.app/pixelstech/feed/alibaba)       |
  | [Apple](https://www.pixelstech.net/feed/apple)           | [apple](https://rsshub.app/pixelstech/feed/apple)           |
  | [Database](https://www.pixelstech.net/feed/database)     | [database](https://rsshub.app/pixelstech/feed/database)     |
  | [Go](https://www.pixelstech.net/feed/go)                 | [go](https://rsshub.app/pixelstech/feed/go)                 |
  | [Huawei](https://www.pixelstech.net/feed/huawei)         | [huawei](https://rsshub.app/pixelstech/feed/huawei)         |
  | [Java](https://www.pixelstech.net/feed/java)             | [java](https://rsshub.app/pixelstech/feed/java)             |
  | [JavaScript](https://www.pixelstech.net/feed/javascript) | [javascript](https://rsshub.app/pixelstech/feed/javascript) |
  | [Linux](https://www.pixelstech.net/feed/linux)           | [linux](https://rsshub.app/pixelstech/feed/linux)           |
  | [LLM](https://www.pixelstech.net/feed/llm)               | [llm](https://rsshub.app/pixelstech/feed/llm)               |
  | [Nvidia](https://www.pixelstech.net/feed/nvidia)         | [nvidia](https://rsshub.app/pixelstech/feed/nvidia)         |
  | [Python](https://www.pixelstech.net/feed/python)         | [python](https://rsshub.app/pixelstech/feed/python)         |
  | [Rust](https://www.pixelstech.net/feed/rust)             | [rust](https://rsshub.app/pixelstech/feed/rust)             |
  | [Tesla](https://www.pixelstech.net/feed/tesla)           | [tesla](https://rsshub.app/pixelstech/feed/tesla)           |
  | [Web](https://www.pixelstech.net/feed/web)               | [web](https://rsshub.app/pixelstech/feed/web)               |
  | [Web3](https://www.pixelstech.net/feed/web3)             | [web3](https://rsshub.app/pixelstech/feed/web3)             |
  | [Zig](https://www.pixelstech.net/feed/zig)               | [zig](https://rsshub.app/pixelstech/feed/zig)               |

</details>
`,categories:[`new-media`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.pixelstech.net/feed/:topic?`],target:`/feed/:topic`},{title:`All`,source:[`www.pixelstech.net/feed/`],target:`/feed`},{title:`AI`,source:[`www.pixelstech.net/feed/ai`],target:`/feed/ai`},{title:`Alibaba`,source:[`www.pixelstech.net/feed/alibaba`],target:`/feed/alibaba`},{title:`Apple`,source:[`www.pixelstech.net/feed/apple`],target:`/feed/apple`},{title:`Database`,source:[`www.pixelstech.net/feed/database`],target:`/feed/database`},{title:`Go`,source:[`www.pixelstech.net/feed/go`],target:`/feed/go`},{title:`Huawei`,source:[`www.pixelstech.net/feed/huawei`],target:`/feed/huawei`},{title:`Java`,source:[`www.pixelstech.net/feed/java`],target:`/feed/java`},{title:`JavaScript`,source:[`www.pixelstech.net/feed/javascript`],target:`/feed/javascript`},{title:`Linux`,source:[`www.pixelstech.net/feed/linux`],target:`/feed/linux`},{title:`LLM`,source:[`www.pixelstech.net/feed/llm`],target:`/feed/llm`},{title:`Nvidia`,source:[`www.pixelstech.net/feed/nvidia`],target:`/feed/nvidia`},{title:`Python`,source:[`www.pixelstech.net/feed/python`],target:`/feed/python`},{title:`Rust`,source:[`www.pixelstech.net/feed/rust`],target:`/feed/rust`},{title:`Tesla`,source:[`www.pixelstech.net/feed/tesla`],target:`/feed/tesla`},{title:`Web`,source:[`www.pixelstech.net/feed/web`],target:`/feed/web`},{title:`Web3`,source:[`www.pixelstech.net/feed/web3`],target:`/feed/web3`},{title:`Zig`,source:[`www.pixelstech.net/feed/zig`],target:`/feed/zig`}],view:0};export{u as handler,d as route};