Compare commits
2 Commits
f5cc7bdb86
...
3e9dae2526
Author | SHA1 | Date |
---|---|---|
quenousimporte | 3e9dae2526 | |
quenousimporte | 0f2449c3ca |
31
epub.php
31
epub.php
|
@ -17,8 +17,13 @@
|
|||
$innerHTM = '';
|
||||
foreach ($node->childNodes as $childNode){
|
||||
$nodeHTML = $childNode->ownerDocument->saveHTML($childNode);
|
||||
|
||||
$nodeHTML = str_replace('<aside', '<b><i', $nodeHTML);
|
||||
$nodeHTML = str_replace('</aside', '</i></b', $nodeHTML);
|
||||
|
||||
$nodeHTML = str_replace('<blockquote', '<b><i', $nodeHTML);
|
||||
$nodeHTML = str_replace('</blockquote', '</i></b', $nodeHTML);
|
||||
|
||||
$innerHTML .= $nodeHTML;
|
||||
}
|
||||
return '<div>' . strip_tags($innerHTML, '<p><b><h2><i><strong>') . '</div>';
|
||||
|
@ -185,7 +190,7 @@
|
|||
// Cafeyn
|
||||
if (isset($_POST['cafeyn']) && $_POST['cafeyn'])
|
||||
{
|
||||
$url = $_POST['cafeynurl'];
|
||||
$url = $_POST['cafeyn'];
|
||||
|
||||
// extract url from curl command
|
||||
if (str_starts_with($url, 'curl '))
|
||||
|
@ -284,7 +289,7 @@
|
|||
// Le Monde
|
||||
if (isset($_POST['lemonde']) && $_POST['lemonde'])
|
||||
{
|
||||
$url = $_POST['lmurl'];
|
||||
$url = $_POST['lemonde'];
|
||||
|
||||
// extract url from curl command
|
||||
if (str_starts_with($url, 'curl '))
|
||||
|
@ -400,11 +405,7 @@
|
|||
// Politis RSS
|
||||
if (isset($_POST['politis']) && $_POST['politis'])
|
||||
{
|
||||
$issuenb = '';
|
||||
if (isset($_POST['politisnb']))
|
||||
{
|
||||
$issuenb = $_POST['politisnb'];
|
||||
}
|
||||
$issuenb = $_POST['politis'];
|
||||
$feedurl = 'https://www.politis.fr/flux-rss-politis-fr/';
|
||||
$opts = [
|
||||
'http' => [
|
||||
|
@ -432,7 +433,7 @@
|
|||
$url = $item->link;
|
||||
$article = file_get_contents($url, false, $context);
|
||||
|
||||
if ($issuenb && !str_contains($article, ' dans l’hebdo N° ' . $issuenb))
|
||||
if (!str_contains($article, ' dans l’hebdo N° ' . $issuenb))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -640,14 +641,12 @@
|
|||
<label for="mptoday">Today only</label>
|
||||
|
||||
<h2>Le Monde</h2>
|
||||
<input id="lemonde" name="lemonde" type="checkbox">
|
||||
<label for="lemonde">From "GetPublicationContentItems" json url: </label>
|
||||
<input name="lmurl">
|
||||
<label for="lemonde">"GetPublicationContentItems" json url: </label>
|
||||
<input id="lemonde" name="lemonde">
|
||||
|
||||
<h2>Cafeyn</h2>
|
||||
<input id="cafeyn" name="cafeyn" type="checkbox">
|
||||
<label for="cafeyn">From "material" json url: </label>
|
||||
<input name="cafeynurl">
|
||||
<label for="cafeyn">"material" json url: </label>
|
||||
<input id="cafeyn" name="cafeyn">
|
||||
|
||||
<h2>The New York Times</h2>
|
||||
<input id="nyt" name="nyt" type="checkbox">
|
||||
|
@ -657,9 +656,7 @@
|
|||
<label for="nyttoday">From today's paper embedded script</label>
|
||||
|
||||
<h2>Politis</h2>
|
||||
<input id="politis" name="politis" type="checkbox">
|
||||
<label for="politis">From RSS.</label>
|
||||
<label for="politisnb">Optional issue number: </label><input id="politisnb" name="politisnb">
|
||||
<label for="politis">Issue number: </label><input id="politis" name="politis">
|
||||
|
||||
<h2>Admin</h2>
|
||||
<input id="emptycache" name="emptycache" type="checkbox" checked>
|
||||
|
|
Loading…
Reference in New Issue