Base de la veille fonctionne

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

36
Article.php Normal file
View File

@ -0,0 +1,36 @@
<?php
class Article {
private String $nom;
private String $desc;
private DateTime $date;
private String $url;
public function __construct(String $n, String $de, DateTime $da, String $u) {
$this -> nom = $n;
$this -> desc = $de;
$this -> date = $da;
$this -> url = $u;
}
public function getArticleName() {
return $this -> nom;
}
public function getArticleDescription() {
return $this -> desc;
}
public function getArticleDate() {
return $this -> date;
}
public function getArticleUrl() {
return $this -> url;
}
public function __toString()
{
return '<ul><li>' .$this->getArticleName() . '</li><li>' .$this->getArticleDescription() . '</li><li>' .date_format($this->getArticleDate(), 'd M Y, H\hi') . '</li><li>' .$this->getArticleUrl() .'</ul>';
}
}

11266
css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

1
css/bootstrap.css.map Normal file

File diff suppressed because one or more lines are too long

7
css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11242
css/bootstrap.rtl.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

7
css/bootstrap.rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
css/style.css Normal file
View File

@ -0,0 +1,4 @@
div.title {
display: block;
margin: auto;
}

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>

5046
js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
js/bootstrap.js.map Normal file

File diff suppressed because one or more lines are too long

7
js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
js/bootstrap.min.js.map Normal file

File diff suppressed because one or more lines are too long