it works rn ig?

This commit is contained in:
yuanhau 2025-06-02 14:43:13 +08:00
parent 8eb19d7242
commit 3ebaff5218
4 changed files with 39 additions and 13 deletions

View file

@ -28,12 +28,25 @@ export default defineEventHandler(async (event) => {
html("div.editor div figure img").attr("srcset") ||
html("div.editor div figure img").attr("src") ||
"";
const bgImage = html("figure.keyVisual img").attr("srcset") || "";
const articles = [];
const otherArticles = html("section.moduleContainer div").html();
/*for (const item in otherArticles) {
console.log(item);
console.log("-");
}*/
const regexArticleLinks = /[a-zA-Z0-9]{7}/g
const otherArticles = <any[]>[];
html("a.ltcp-link")
.each((i, element) => {
const articleLink = html(element).attr("href");
const articleTitle = html(element).find("h3.header").text();
const date = html(element).find("div._articleCard div.css-wqleh6 span").text();
if (articleLink && articleTitle) {
const articleSlug = articleLink.matchAll(regexArticleLinks);
otherArticles.push({
index: i,
title: articleTitle,
link: articleSlug,
date: date,
});
}
});
return {
name: newsOrgName,
description: description,