fix(route/gameapps): fix selectors (#21703)

This commit is contained in:
Tony 2026-04-13 03:48:33 +08:00 committed by GitHub
parent 2af8e30e1c
commit c8ed099850
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import parser from '@/utils/rss-parser';
export const route: Route = {
path: '/',
example: '/gameapps',
categories: ['game'],
radar: [
{
source: ['gameapps.hk/'],
@ -36,7 +37,7 @@ async function handler() {
});
const $ = load(response);
item.title = $('meta[property="og:title"]').attr('content') ?? $('.news-title h1').text();
item.title = ($('meta[property="og:title"]').attr('content') ?? $('.news-title h1').text()).replace(' - 香港手機遊戲網 GameApps.hk', '');
item.category = $('.tags-wrap .tag-item')
.toArray()
.map((el) => $(el).text().trim().replace(/^#/, ''));
@ -49,7 +50,7 @@ async function handler() {
delete item.isoDate;
const intro = $('div.introduction.media.news-intro div.media-body').html()?.trim();
const desc = $('.article-content').html()?.trim();
const desc = $('.article-content, .news-content').html()?.trim();
item.description = renderToString(
<>
{intro ? raw(intro) : null}