Base de la veille fonctionne

This commit is contained in:
2022-02-21 17:54:44 +01:00
parent 2159d5cf39
commit e8e9d1ad95
15 changed files with 27661 additions and 0 deletions

40
index.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
include './Article.php';
$url = "http://fetchrss.com/rss/6213baca199e171a5d6eacc26213babd69097e19dd230f73.xml"; /* insérer ici l'adresse du flux RSS de votre choix */
$rss = simplexml_load_file($url);
$tabArticle = array();
foreach ($rss->channel->item as $item){
$desc = explode("</div>", explode('<div class="content">', $item->description)[1]);
array_push($tabArticle, new Article($item->title, $desc[0], date_create($item->pubDate), $item->link));
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Veille Technologique Framework PHP</title>
<link rel="stylesheet" href="./css/bootstrap.css" />
</head>
<body>
<div class="title">
<p>Veille Technologique | Framework PHP</p>
</div>
<?php
foreach ($tabArticle as $a) {
echo $a.'<br />';
}
?>
</body>
<script src="./js/bootstrap.js"></script>
</html>