Showing 2 changed files with 18 additions and 12 deletions
-8
sources/news-huffingtonpost.fr.php
... ...
@@ -39,7 +39,6 @@ if ($xml === false) {
39 39
     $pos_stop = strpos($item->description, $SEARCH_SUB2, $pos_start);
40 40
     $article['image']=$item->mediacontent['url'];
41 41
     $articles[$cpt] = $article;  
42
-    echo "\n";
43 42
     echo '               <div onclick="onArticle('.$cpt.')" style="display:inline;">';
44 43
     echo '<img src="'.$article['image'].'" style="display:inline;" width="100%"><br>';
45 44
     echo '<div id="nav-up" style="display:inline;"><a href="#top"><i class="fa fa-home fa-2x"></i></a></div>&nbsp;&nbsp;';
... ...
@@ -52,19 +51,12 @@ if ($xml === false) {
52 51
     }
53 52
   }
54 53
 }
55
-echo "\n";
56 54
 echo '            </div><!-- ./panel-body -->';
57
-echo "\n";
58 55
 echo '            </div><!-- ./panel panel-default -->';
59
-echo "\n";
60 56
 echo '            </div><!-- ./col-md-6 -->';
61
-echo "\n";
62 57
 echo '<div class="col-md-6">';
63
-echo "\n";
64 58
 echo '<div class="panel panel-default">';
65
-echo "\n";
66 59
 echo '<div class="panel-body">';
67
-echo "\n";
68 60
 echo '<a name="article-top"></a><div id="article-current"></div>';
69 61
 $cpt=0;
70 62
 foreach ($articles as $article ) {
+18 -4
sources/news-liberation.fr.php
... ...
@@ -87,10 +87,20 @@ foreach ($articles as $article ) {
87 87
       if($pos_stop) {
88 88
         $article_only = substr($article_only, 0, $pos_stop);
89 89
       } else {
90
-        echo "pos_stop null";
90
+        $article_only = "Oups";
91 91
       }
92 92
     } else {
93
-      echo "pos_start null";
93
+      $article_only = "";
94
+      $articles = $doc->getElementsByTagName('div');
95
+      foreach ( $articles as $node) {
96
+        if(0==strcmp("answer-body",$node->getAttribute('class'))) {
97
+          $article_only = "<h3>".$article['title']."</h3>".DOMinnerHTML($node);
98
+        }else if(0==strcmp("live-content",$node->getAttribute('class'))) {
99
+          //$article_only = "<h3>".$article['title']."</h3>".DOMinnerHTML($node);
100
+          $temp = DOMinnerHTML($node);
101
+          $article_only = $article_only.$temp;
102
+        }
103
+      }
94 104
     }
95 105
   }
96 106
 
... ...
@@ -113,6 +123,8 @@ foreach ($articles as $article ) {
113 123
       '<i class="zoom-icon"> <svg class="icon " role="img" width="22" height="22"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-zoom"></use></svg></i>',
114 124
       ' onload="lmd.pic(this);" onerror="lmd.pic(this);" class="lazy-retina"',
115 125
       ' width="960">',
126
+      '<img class="live-image"',
127
+      '<a class="slug"',
116 128
       '<figcaption class="legende" data-caption="',
117 129
       '</figcaption>' );
118 130
   $newStrings = array( '<p>',
... ...
@@ -130,6 +142,8 @@ foreach ($articles as $article ) {
130 142
       '',
131 143
       '',
132 144
       ' width="100%">',
145
+      '<img width="100%"',
146
+      '<a',
133 147
       '<em>',
134 148
       '</em>' );
135 149
 
... ...
@@ -151,8 +165,8 @@ foreach ($articles as $article ) {
151 165
   $re = '/<span class="share">(.+?)<\/span>/';
152 166
   $temp = preg_replace($re, '', $article_only); 
153 167
   $article_only = $temp;
154
-  $orgStrings = array( '<ul class="article-rel-list">','<li class="article-rel-item">  </li>','</ul>');
155
-  $newStrings = array( '','','' );
168
+  $orgStrings = array( '<ul class="article-rel-list">','<li class="article-rel-item">  </li>','</ul>', '<a href=');
169
+  $newStrings = array( '','','', '<a target="new" href=' );
156 170
   $article_only = str_replace($orgStrings, $newStrings, $article_only);
157 171
   echo '<div id="nav-up" style="display:inline;"><a href="#top"><i class="fa fa-home fa-2x"></i></a></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
158 172
   echo '<div id="nav-source" style="display:inline;"><a href="'.$article['link'].'" target="new-'.$cpt.'"><i class="fa fa-link fa-2x"></i></a></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';