feat: Added a lot of new section rewrites

This commit is contained in:
2026-05-22 11:22:17 +02:00
parent 8d4ff16d9b
commit fe6682a76a
17 changed files with 839 additions and 3 deletions
+44
View File
@@ -0,0 +1,44 @@
(() => {
const container = document.querySelector('main#main #AjaxMainSection .section_guidepost_before .vc-articlebox');
if (!container) return null;
const headerEl = container.querySelector('.header span');
const sectionTitle = headerEl ? headerEl.textContent.trim() : null;
const articleNodes = container.querySelectorAll('.content.articles a.article');
const articles = Array.from(articleNodes).map(article => {
const link = article.getAttribute('href');
const titleEl = article.querySelector('.title');
const title = titleEl ? titleEl.textContent.trim() : null;
const dateEl = article.querySelector('.date');
const date = dateEl ? dateEl.textContent.trim() : null;
const annotationEl = article.querySelector('.annotation');
const annotation = annotationEl ? annotationEl.textContent.trim() : null;
const imgEl = article.querySelector('.img img');
const imageSrc = imgEl ? (imgEl.getAttribute('data-src') || imgEl.getAttribute('src')) : null;
const imageAlt = imgEl ? imgEl.getAttribute('alt') : null;
return {
title,
link,
date,
annotation,
imageSrc,
imageAlt
};
});
const moreBtn = container.querySelector('.footer a.moreBtn');
const moreLink = moreBtn ? moreBtn.getAttribute('href') : null;
return {
sectionTitle,
articles,
moreLink
};
})();