UNPKG

rsshub

Version:
33 lines (32 loc) 1.52 kB
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs"; import { t as got_default } from "./got-BTowW50G.mjs"; //#region lib/routes/amazon/awsblogs.ts const route = { path: "/awsblogs/:locale?", categories: ["blog"], example: "/amazon/awsblogs", parameters: { locale: "Blog posts in a specified language, only the following options are supported. Default `zh_CN`" }, description: `| zh\\_CN | en\\_US | fr\\_FR | de\\_DE | ja\\_JP | ko\\_KR | pt\\_BR | es\\_ES | ru\\_RU | id\\_ID | tr\\_TR | | ------- | ------- | ------ | ------ | -------- | ------ | ---------- | ------- | ------- | ---------- | ------- | | Chinese | English | French | German | Japanese | Korean | Portuguese | Spanish | Russian | Indonesian | Turkish |`, name: "AWS Blogs", maintainers: ["HankChow"], handler }; async function handler(ctx) { const items = (await got_default({ url: `https://aws.amazon.com/api/dirs/items/search?item.directoryId=blog-posts&sort_by=item.additionalFields.createdDate&sort_order=desc&size=50&item.locale=${ctx.req.param("locale") ?? "zh_CN"}` })).data.items; return { title: "AWS Blog", link: "https://aws.amazon.com/blogs/", description: "AWS Blog 更新", item: items && items.map((item) => ({ title: item.item.additionalFields.title, description: item.item.additionalFields.postExcerpt, pubDate: parseDate(item.item.dateCreated), link: item.item.additionalFields.link, author: item.item.additionalFields.contributors })) }; } //#endregion export { route };