mp add category
This commit is contained in:
parent
e0d841c594
commit
b89000197f
4
epub.php
4
epub.php
|
@ -47,6 +47,7 @@
|
||||||
$author = $finder->query('//a[contains(@href, "biographie")]')->item(0)->textContent;
|
$author = $finder->query('//a[contains(@href, "biographie")]')->item(0)->textContent;
|
||||||
$date = trim($finder->query('//time')->item(1)->textContent);
|
$date = trim($finder->query('//time')->item(1)->textContent);
|
||||||
$summary = $finder->query('//p[contains(@class, "news__heading__top__intro")]')->item(0)->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
|
// strip images
|
||||||
$toremove = $finder->query('//svg');
|
$toremove = $finder->query('//svg');
|
||||||
|
@ -66,6 +67,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = '<h1>' . $title . '</h1>';
|
$result = '<h1>' . $title . '</h1>';
|
||||||
|
$result .= '<p><em>' . $category . '</em></p>';
|
||||||
$result .= '<p>' . $author . '</p>';
|
$result .= '<p>' . $author . '</p>';
|
||||||
$result .= '<p>' . $date . '</p>';
|
$result .= '<p>' . $date . '</p>';
|
||||||
$result .= '<p><b>' . $summary . '</b></p>';
|
$result .= '<p><b>' . $summary . '</b></p>';
|
||||||
|
@ -470,7 +472,7 @@
|
||||||
$date = $finder->query('//span[@class="date"]')->item(0)->textContent;
|
$date = $finder->query('//span[@class="date"]')->item(0)->textContent;
|
||||||
$summary = $finder->query('//div[@class="extrait"]')->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")]');
|
$zooms = $finder->query('//div[contains(@class,"gt_zoom")]');
|
||||||
foreach ($zooms as $zoom)
|
foreach ($zooms as $zoom)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue