mp add category

This commit is contained in:
quenousimporte 2024-09-13 11:35:56 +02:00
parent e0d841c594
commit b89000197f
1 changed files with 3 additions and 1 deletions

View File

@ -47,6 +47,7 @@
$author = $finder->query('//a[contains(@href, "biographie")]')->item(0)->textContent;
$date = trim($finder->query('//time')->item(1)->textContent);
$summary = $finder->query('//p[contains(@class, "news__heading__top__intro")]')->item(0)->textContent;
$category = trim($finder->query('//p[contains(@class,"news__heading__top__kicker")]')->item(0)->textContent);
// strip images
$toremove = $finder->query('//svg');
@ -66,6 +67,7 @@
}
$result = '<h1>' . $title . '</h1>';
$result .= '<p><em>' . $category . '</em></p>';
$result .= '<p>' . $author . '</p>';
$result .= '<p>' . $date . '</p>';
$result .= '<p><b>' . $summary . '</b></p>';
@ -470,7 +472,7 @@
$date = $finder->query('//span[@class="date"]')->item(0)->textContent;
$summary = $finder->query('//div[@class="extrait"]')->item(0)->textContent;
// tranform "zoom" divs into aside tags
// transform "zoom" divs into aside tags
$zooms = $finder->query('//div[contains(@class,"gt_zoom")]');
foreach ($zooms as $zoom)
{