Showing 1 changed files with 31 additions and 0 deletions
+31
sources/news-slate.fr.php
... ...
@@ -180,6 +180,37 @@ foreach ($articles as $article ) {
180 180
   $re='/<span class="sharing-btn__bg"><\/span>/';
181 181
   $temp = preg_replace($re, '', $article_only); 
182 182
   $article_only = $temp;
183
+
184
+  $re='/<script data-cfasync="false" src=(.+)<\/script><script>(.+?)<\/script>/';
185
+  $temp = preg_replace($re, '', $article_only); 
186
+  $article_only = $temp;
187
+
188
+  //Clean so called social
189
+  $re='/<a data-share="(fb|li|tw)" data-url="(.+)">  <div>/';
190
+  $temp = preg_replace($re, '<a><div>', $article_only); 
191
+  $article_only = $temp;
192
+  $re='/<a class="sharing-btn sharing-btn--circle sharing-btn--whatsapp" href="whatsapp:(.+)>  <div>/';
193
+  $temp = preg_replace($re, '<a><div>', $article_only); 
194
+  $article_only = $temp;
195
+  $re='/<a href="fb-messenger:(.+) class="sharing-btn sharing-btn--circle sharing-btn--messenger" target="_blank">  <div>/';
196
+  $temp = preg_replace($re, '<a><div>', $article_only); 
197
+  $article_only = $temp;
198
+  $re='/<a href="https:\/\/www\.facebook\.com\/dialog\/send(.+)target="_blank">  <div>/';
199
+  $temp = preg_replace($re, '<a><div>', $article_only); 
200
+  $article_only = $temp;
201
+  $re='/<div id="inreadbis" class="ad-wrapper"><span id="wrapper_inread"><div(.+)<\/div><\/span><\/div>/';
202
+  $temp = preg_replace($re, '', $article_only); 
203
+  $article_only = $temp;
204
+  $re='/<\/div> <\/a> <a><div>/';
205
+  $temp = preg_replace($re, '',$article_only);
206
+  $article_only = $temp;
207
+
208
+  //Remove Emptylines
209
+  $temp = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $article_only);
210
+  $article_only = $temp;
211
+  $temp = preg_replace('/\s\s+/', ' ', $article_only);
212
+  $article_only = $temp;
213
+
183 214
   
184 215
   $re='/<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" height="(.+?)" src="https:\/\/www\.youtube\.com\/embed\/(.+?)" width="(.+?)"><\/iframe>/';
185 216
   //$temp = preg_replace($re, '<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" width="100%" src="https:\/\/www\.youtube\.com\/embed\/\\2"><\/iframe>', $article_only);