From cbad497b4e169835adae43ba6a588c084b7d7441 Mon Sep 17 00:00:00 2001 From: bastien ollier Date: Wed, 7 Dec 2022 08:11:15 +0100 Subject: [PATCH] add listes sources a appel.php --- RssParser.php | 11 +++-------- appel.php | 21 +++++++++++++++++++-- config.php | 1 + 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/RssParser.php b/RssParser.php index dd0a17b..aabdf20 100644 --- a/RssParser.php +++ b/RssParser.php @@ -1,15 +1,14 @@ channel->item as $item) @@ -19,10 +18,6 @@ class RssParser $pubdate = $item->pubDate; $link = $item->link; $listeArticles[] = new News($title,$description,$pubdate,$link); - - // Create summary as a shortened body and remove images, - // extraneous line breaks, etc. - //$post->summary = $this->summarizeText($post->text); } return $listeArticles; diff --git a/appel.php b/appel.php index c2cf883..416678d 100644 --- a/appel.php +++ b/appel.php @@ -1,12 +1,29 @@ - +w getSources(); +foreach($listeSources as $source){ + echo $source; + $resultFlux = $parser->getResultFlux($source); + foreach($resultFlux as $n){ + $gateNews->addNews($n); + } +} +/* $resultFlux = $parser->getResultFlux("https://www.lemonde.fr/sciences/rss_full.xml"); foreach($resultFlux as $n){ + $gateNews->addNews($n); echo $n->getTitle(); echo "
"; echo $n->getPubdate(); @@ -17,7 +34,7 @@ foreach($resultFlux as $n){ echo "
"; echo "
"; } - +*/ ?> diff --git a/config.php b/config.php index 4a9f850..3e4baaf 100644 --- a/config.php +++ b/config.php @@ -1,4 +1,5 @@