fix(route/gameapps): add item category extraction and clean up unwanted elements (#21605)
This commit is contained in:
parent
6cd8be3b5a
commit
f2ed334627
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue