fix(routes/qstheory/magazine): adapt to origin site changed (#18181)

- origin website now use relative path
- origin website changed struct for list page(no '<span>')
This commit is contained in:
cnk 2025-01-21 23:45:18 +08:00 committed by GitHub
parent 5d9e0f557e
commit f1e82d61ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ export const route: Route = {
},
],
name: '在线读刊',
maintainers: ['TonyRL'],
maintainers: ['TonyRL', 'cscnk52'],
handler,
};
@ -34,14 +34,14 @@ async function handler(ctx) {
const $item = $(item);
return {
title: $item.text(),
link: $item.attr('href')!,
link: new URL($item.attr('href')!, baseUrl).href,
};
});
const issueResponse = await ofetch(yearList[0].link);
const $$ = cheerio.load(issueResponse);
const list = $$('.highlight span a')
const list = $$('.highlight a')
.toArray()
.map((item) => {
const $item = $$(item);