simplify params

This commit is contained in:
quenousimporte 2024-09-04 18:20:11 +02:00
parent 0f2449c3ca
commit 3e9dae2526
1 changed files with 9 additions and 17 deletions

View File

@ -190,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 '))
@ -289,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 '))
@ -405,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' => [
@ -437,7 +433,7 @@
$url = $item->link;
$article = file_get_contents($url, false, $context);
if ($issuenb && !str_contains($article, ' dans lhebdo N° ' . $issuenb))
if (!str_contains($article, ' dans lhebdo N° ' . $issuenb))
{
continue;
}
@ -645,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">
@ -662,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>