fix(route/gameapps): add item category extraction and clean up unwanted elements (#21605)

This commit is contained in:
Tony 2026-04-02 21:42:05 +08:00 committed by GitHub
parent 6cd8be3b5a
commit f2ed334627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -37,8 +37,11 @@ async function handler() {
const $ = load(response);
item.title = $('meta[property="og:title"]').attr('content') ?? $('.news-title h1').text();
item.category = $('.tags-wrap .tag-item')
.toArray()
.map((el) => $(el).text().trim().replace(/^#/, ''));
$('.pages').remove();
$('.pages, .article-ad, .social-actions, .news-footer').remove();
// remove unwanted key value
delete item.content;