1 contributor
<?php
define('NEWS_RSS_LEMONDE', 'http://www.lemonde.fr/rss/une.xml');
define('NEWS_RSS_LIBERATION', 'http://rss.liberation.fr/rss/latest/');
define('NEWS_RSS_SLATEFR', 'https://www.slate.fr/rss.xml');
define('NEWS_RSS_VICEFR', 'https://www.vice.com/fr/rss');
define('NEWS_RSS_LESINROCKS', 'http://www.lesinrocks.com/feeds/feed-a-la-une/');
define('NEWS_RSS_NUMERAMA', 'http://www.numerama.com/rss/news.rss');
define('NEWS_RSS_HUFFINGTONPOSTFR', 'http://www.huffingtonpost.fr/feeds/index.xml');
$NEWS_RSS_MAX_ITEMS = 10;
function DOMinnerHTML(DOMNode $element)
{
$innerHTML = "";
$children = $element->childNodes;
foreach ($children as $child)
{
$innerHTML .= $element->ownerDocument->saveHTML($child);
}
return $innerHTML;
}
function http_get_contents($url, $opts = [])
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, "Wget 1");
curl_setopt($ch, CURLOPT_URL, $url);
if(is_array($opts) && $opts) {
foreach($opts as $key => $val) {
curl_setopt($ch, $key, $val);
}
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if(FALSE === ($retval = curl_exec($ch))) {
error_log(curl_error($ch));
} else {
return $retval;
}
}
?>