Showing 1 changed files with 4 additions and 1 deletions
+4 -1
sources/news-huffingtonpost.fr.php
... ...
@@ -2,6 +2,9 @@
2 2
 include_once( 'news-constants.php' );
3 3
 
4 4
 $rss_content = file_get_contents(NEWS_RSS_HUFFINGTONPOSTFR);
5
+$orgStrings = array( 'media:content');
6
+$newStrings = array( 'mediacontent');
7
+$rss_content  = str_replace($orgStrings, $newStrings, $rss_content);
5 8
 $xml = simplexml_load_string($rss_content);
6 9
 if ($xml === false) {
7 10
   echo 'Failed to read RSS';
... ...
@@ -34,7 +37,7 @@ if ($xml === false) {
34 37
     $pos_start += strlen($SEARCH_SUB1);
35 38
     $SEARCH_SUB2="\"";
36 39
     $pos_stop = strpos($item->description, $SEARCH_SUB2, $pos_start);
37
-    $article['image']=substr($item->description, $pos_start, $pos_stop - $pos_start);
40
+    $article['image']=$item->mediacontent['url'];
38 41
     $articles[$cpt] = $article;  
39 42
     echo '<div onclick="onArticle('.$cpt.')" style="display:inline;">';
40 43
     echo '<img src="'.$article['image'].'" style="display:inline;" width="100%"><br>';