Base de la veille fonctionne
This commit is contained in:
parent
2159d5cf39
commit
e8e9d1ad95
36
Article.php
Normal file
36
Article.php
Normal 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
11266
css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
css/bootstrap.css.map
Normal file
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
7
css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
css/bootstrap.min.css.map
Normal file
1
css/bootstrap.min.css.map
Normal file
File diff suppressed because one or more lines are too long
11242
css/bootstrap.rtl.css
vendored
Normal file
11242
css/bootstrap.rtl.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
css/bootstrap.rtl.css.map
Normal file
1
css/bootstrap.rtl.css.map
Normal file
File diff suppressed because one or more lines are too long
7
css/bootstrap.rtl.min.css
vendored
Normal file
7
css/bootstrap.rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
css/bootstrap.rtl.min.css.map
Normal file
1
css/bootstrap.rtl.min.css.map
Normal file
File diff suppressed because one or more lines are too long
4
css/style.css
Normal file
4
css/style.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
div.title {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
}
|
40
index.php
Normal file
40
index.php
Normal 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
5046
js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
js/bootstrap.js.map
Normal file
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
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
1
js/bootstrap.min.js.map
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user