add mp rss summary

This commit is contained in:
quenousimporte 2024-08-26 11:01:20 +02:00
parent bb11d11087
commit f01bd12d3d
1 changed files with 17 additions and 1 deletions

View File

@ -567,6 +567,10 @@
<br> <br>
<input id="forcempcookies" name="forcempcookies" type="checkbox"> <input id="forcempcookies" name="forcempcookies" type="checkbox">
<label for="forcempcookies">Force cookies</label> <label for="forcempcookies">Force cookies</label>
<br>
<input id="mptoday" name="mptoday" type="checkbox" disabled>
<label for="mptoday">Today only</label>
<br>
<br><br> <br><br>
@ -590,6 +594,18 @@
</div> </div>
<br> <br>
<a href="../epub">Fichiers générés</a><br> <a href="../epub">Fichiers générés</a><br>
<a href="../">Revue de presse</a> <a href="../">Revue de presse</a><br>
<br>
<b>Mediapart RSS summary</b>
<br>
<?php
$mprss = file_get_contents('https://www.mediapart.fr/articles/feed', false, $context);
$xml = new SimpleXMLElement($mprss);
$items = $xml->xpath("/rss/channel/item");
foreach ($items as $item)
{
echo '<div><a href="'.$item->link.'">'.$item->pubDate. ' '.$item->title.'</a></div>';
}
?>
</body> </body>
</html> </html>