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{load as r}from"cheerio";const i=async i=>{let{category:a}=i.req.param(),o=Number.parseInt(i.req.query(`limit`)??`30`,10),s=new URL(`gold-news${a?`/${a}`:``}`,`https://bullionvault.com`).href,c=r(await e(s)),l=c(`html`).attr(`lang`)??`en`,u=c(`section#block-bootstrap-views-block-latest-articles-block div.media, div.gold-news-content table tr`).slice(0,o).toArray().map(e=>{let t=c(e),r=t.find(`td.views-field-title a, div.views-field-title a`).first(),i=r.text(),a=t.find(`td.views-field-created, div.views-field-created`).text().trim(),o=r.attr(`href`),s=t.find(`a.username`).toArray().map(e=>{let t=c(e);return{name:t.text(),url:t.attr(`href`),avatar:void 0}}),u=a;return{title:i,pubDate:a?n(a):void 0,link:o,author:s,updated:u?n(u):void 0,language:l}});return u=(await Promise.all(u.map(i=>i.link?t.tryGet(i.link,async()=>{let t=r(await e(i.link)),a=t(`article.article h1`).text(),o=t(`div.content`).html()??``,s=t(`div.submitted`).text().split(/,/).pop(),c=t(`meta[name="news_keywords"]`).attr(`content`)?.split(/,/)??[],u=t(`div.view-author-bio`).toArray().map(e=>{let n=t(e);return{name:n.find(`h1`).text(),url:void 0,avatar:n.find(`img`).attr(`src`)}}),d=s,f={title:a,description:o,pubDate:s?n(s):i.pubDate,category:c,author:u,content:{html:o,text:o},updated:d?n(d):i.updated,language:l};return{...i,...f}}):i))).filter(e=>!0),{title:c(`title`).text(),description:c(`meta[property="og:description"]`).attr(`content`),link:s,item:u,allowEmpty:!0,image:c(`meta[property="og:image"]`).attr(`content`),author:c(`meta[property="og:title"]`).attr(`content`)?.split(/\|/).pop(),language:l,id:c(`meta[property="og:url"]`).attr(`content`)}},a={path:`/gold-news/:category?`,name:`Gold News`,url:`bullionvault.com`,maintainers:[`nczitzk`],handler:i,example:`/bullionvault/gold-news`,parameters:{category:{description:`Category`,options:[{label:`Gold market analysis & gold investment research`,value:``},{label:`Opinion & Analysis`,value:`opinion-analysis`},{label:`Gold Price News`,value:`gold-price-news`},{label:`Investment News`,value:`news`},{label:`Gold Investor Index`,value:`gold-investor-index`},{label:`Gold Infographics`,value:`infographics`},{label:`Market Fundamentals`,value:`market-fundamentals`}]}},description:`::: tip
If you subscribe to [Gold Price News](https://www.bullionvault.com/gold-news/gold-price-news)，where the URL is \`https://www.bullionvault.com/gold-news/gold-price-news\`, extract the part \`https://www.bullionvault.com/gold-news/\` to the end, and use it as the parameter to fill in. Therefore, the route will be [\`/bullionvault/gold-news/gold-price-news\`](https://rsshub.app/bullionvault/gold-news/gold-price-news).
:::

| Category                                                                          | ID                                                                                   |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [Opinion & Analysis](https://www.bullionvault.com/gold-news/opinion-analysis)     | [opinion-analysis](https://rsshub.app/bullionvault/gold-news/opinion-analysis)       |
| [Gold Price News](https://www.bullionvault.com/gold-news/gold-price-news)         | [gold-price-news](https://rsshub.app/bullionvault/gold-news/gold-price-news)         |
| [Investment News](https://www.bullionvault.com/gold-news/news)                    | [news](https://rsshub.app/bullionvault/gold-news/news)                               |
| [Gold Investor Index](https://www.bullionvault.com/gold-news/gold-investor-index) | [gold-investor-index](https://rsshub.app/bullionvault/gold-news/gold-investor-index) |
| [Gold Infographics](https://www.bullionvault.com/gold-news/infographics)          | [infographics](https://rsshub.app/bullionvault/gold-news/infographics)               |
| [Market Fundamentals](https://www.bullionvault.com/gold-news/market-fundamentals) | [market-fundamentals](https://rsshub.app/bullionvault/gold-news/market-fundamentals) |
`,categories:[`finance`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`bullionvault.com/gold-news/:category`],target:e=>{let t=e.category;return`/bullionvault/gold-news${t?`/${t}`:``}`}},{title:`Gold market analysis & gold investment research`,source:[`bullionvault.com/gold-news`],target:`/gold-news`},{title:`Opinion & Analysis`,source:[`bullionvault.com/gold-news/opinion-analysis`],target:`/gold-news/opinion-analysis`},{title:`Gold Price News`,source:[`bullionvault.com/gold-news/gold-price-news`],target:`/gold-news/gold-price-news`},{title:`Investment News`,source:[`bullionvault.com/gold-news/news`],target:`/gold-news/news`},{title:`Gold Investor Index`,source:[`bullionvault.com/gold-news/gold-investor-index`],target:`/gold-news/gold-investor-index`},{title:`Gold Infographics`,source:[`bullionvault.com/gold-news/infographics`],target:`/gold-news/infographics`},{title:`Market Fundamentals`,source:[`bullionvault.com/gold-news/market-fundamentals`],target:`/gold-news/market-fundamentals`}],view:0};export{i as handler,a as route};