change parameters

change links
This commit is contained in:
quenousimporte 2024-06-05 12:10:54 +02:00
parent 1b6c2fee28
commit 54283eeaa5
2 changed files with 10 additions and 15 deletions

View File

@ -41,6 +41,9 @@
// Le Monde // Le Monde
if (isset($_POST['lemonde']) && $_POST['lemonde']) if (isset($_POST['lemonde']) && $_POST['lemonde'])
{ {
// hardcoded for now
$includeimages = false;
$includecover = false;
$url = $_POST['lmurl']; $url = $_POST['lmurl'];
// extract url from curl command // extract url from curl command
@ -55,7 +58,7 @@
$epub->epub_file = 'epub/lemonde.epub'; $epub->epub_file = 'epub/lemonde.epub';
$epub->title = 'Le Monde ' . $date ; $epub->title = 'Le Monde ' . $date ;
if ($lm_includecover) if ($includecover)
{ {
// todo get correct cover according to date and time // todo get correct cover according to date and time
$coverurl = 'https://www.lemonde.fr/thumbnail/journal/'. $date .'/1000/1490'; $coverurl = 'https://www.lemonde.fr/thumbnail/journal/'. $date .'/1000/1490';
@ -101,7 +104,7 @@
$pagecontent .= '<b>' . $articlebody->Introduction . '</b>'; $pagecontent .= '<b>' . $articlebody->Introduction . '</b>';
} }
if ($lm_includeimages) if ($includeimages)
{ {
$images = array_values(array_filter($article->ContentItem, function($item) { return $item->ContentType == 'graphic/jpeg' || $item->ContentType == 'image/jpeg'; })); $images = array_values(array_filter($article->ContentItem, function($item) { return $item->ContentType == 'graphic/jpeg' || $item->ContentType == 'image/jpeg'; }));
foreach ($images as $image) foreach ($images as $image)
@ -363,17 +366,6 @@
} }
?> ?>
<h3>Existing Files</h3>
<div>
<?php
$files = glob('epub/*');
foreach ($files as $file)
{
echo date('F d Y H:i:s', filemtime($file)) . ' <a href="' . $file . '">' . str_replace('epub/', '', $file) . '</a><br>';
}
?>
</div>
<h3>Generate epub</h3> <h3>Generate epub</h3>
<div> <div>
<form method="post"> <form method="post">
@ -381,6 +373,8 @@
Parameters: Parameters:
<br> <br>
GetPublicationContentItems url: <input name="lmurl"><br> GetPublicationContentItems url: <input name="lmurl"><br>
<!--Update MPSESSID: <input name="mpsessid"><br>
Update NYT-S: <input name="nyts"><br>-->
<br> <br>
Newspapers: Newspapers:
@ -404,5 +398,8 @@
<input type="submit"> <input type="submit">
</form> </form>
</div> </div>
<br>
<a href="../epub">Fichiers générés</a><br>
<a href="../">Revue de presse</a>
</body> </body>
</html> </html>

View File

@ -1,6 +1,4 @@
<?php <?php
$lm_includeimages = false;
$lm_includecover = false;
$mp_sessionid = ''; $mp_sessionid = '';
$nyt_sessionid = '' $nyt_sessionid = ''
?> ?>