Vérification magpie rss

This commit is contained in:
Michael RICOIS 2011-12-07 13:47:58 +00:00
parent f04a4f50e8
commit 21bf561294

View File

@ -647,7 +647,7 @@ class IdentiteController extends Zend_Controller_Action
$session = new SessionEntreprise($this->siret, $this->id);
$url = 'http://news.google.fr/news?hl=fr&ned=fr&q='.
urlencode('"'.$session->getRaisonSociale().'"').'&output=rss';
urlencode('"'.$session->getRaisonSociale().'"').'&output=rss';
define('MAGPIE_CACHE_ON', false);
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
@ -655,8 +655,10 @@ class IdentiteController extends Zend_Controller_Action
define('MAGPIE_DETECT_ENCODING', false);
require_once ('Vendors/magpierss/rss_fetch.inc');
$rss = fetch_rss($url);
$items = array_slice($rss->items, 0, 15);
$items = array();
if ($rss!==false){
$items = array_slice($rss->items, 0, 15);
}
$this->view->assign('items', $items);
}