You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
738 B

<?php
$user= 'jeducourth';
$pass='achanger';
$dsn='mysql:host=localhost;dbname=dbjeducourth';
require_once("../usages/connection.php");
require_once("../models/news.php");
require_once("../models/sources.php");
require_once("../gateways/gatewayNews.php");
require_once("../gateways/gatewaySources.php");
require("RssParser.php");
$parser = new RssParser();
$gatewayNew = new gatewayNews(new Connection($dsn,$user,$pass));
$gatewaySource = new gatewaySources(new Connection($dsn,$user,$pass));
$listeSources = $gatewaySource->getSources();
foreach($listeSources as $source){
$resultFlux = $parser->getResultFlux($source->getLink());
foreach($resultFlux as $n){
$gatewayNew->addNews($n);
}
}
?>