... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
include_once( 'news-constants.php' ); |
3 | 3 |
|
4 | 4 |
$rss_content = file_get_contents(NEWS_RSS_NYT); |
5 |
-$orgStrings = array( 'media:thumbnail'); |
|
5 |
+$orgStrings = array( 'media:content'); |
|
6 | 6 |
$newStrings = array( 'mediacontent'); |
7 | 7 |
$rss_content = str_replace($orgStrings, $newStrings, $rss_content); |
8 | 8 |
$xml = simplexml_load_string($rss_content); |
... | ... |
@@ -27,7 +27,7 @@ if ($xml === false) { |
27 | 27 |
$article['image']=$item->mediacontent['url']; |
28 | 28 |
$articles[$cpt] = $article; |
29 | 29 |
echo '<div onclick="onArticle('.$cpt.')" style="display:inline;">'; |
30 |
- echo '<img id="img-list" src="'.$article['image'].'" style="display:inline;"><br>'; |
|
30 |
+ echo '<img id="img-list" src="'.$article['image'].'" style="display:block;"><br>'; |
|
31 | 31 |
echo '<div id="nav-up" style="display:inline;"><a href="#top"><i class="fa fa-home fa-2x"></i></a></div> '; |
32 | 32 |
echo '<div id="nav-up" style="display:inline;"><a href="#article-top"><i class="fa fa-chevron-down fa-2x"></i></a></div> '; |
33 | 33 |
echo $article['title'].' '; |
... | ... |
@@ -67,26 +67,6 @@ foreach ($articles as $article ) { |
67 | 67 |
$article_only = DOMinnerHTML($node); |
68 | 68 |
} |
69 | 69 |
|
70 |
- $SEARCH_SUB='<span class="ea_article">édition abonné</span>'; |
|
71 |
- $pos_start=strpos($article_content, $SEARCH_SUB); |
|
72 |
- if($pos_start) { |
|
73 |
- $article_abonne = str_replace("www.lemonde.fr", "abonnes.lemonde.fr", $article['link']); |
|
74 |
- $article_content = file_get_contents($article_abonne); |
|
75 |
- $doc = new DOMDocument(); |
|
76 |
- $doc->preserveWhiteSpace = false; |
|
77 |
- $doc->formatOutput = true; |
|
78 |
- $libxml_previous_state = libxml_use_internal_errors(true); |
|
79 |
- $doc->loadHTML($article_content); |
|
80 |
- libxml_clear_errors(); |
|
81 |
- libxml_use_internal_errors($libxml_previous_state); |
|
82 |
- $articles = $doc->getElementsByTagName('article'); |
|
83 |
- $article_only=""; |
|
84 |
- foreach ( $articles as $node) { |
|
85 |
- $article_only = DOMinnerHTML($node); |
|
86 |
- } |
|
87 |
- } |
|
88 |
- |
|
89 |
- |
|
90 | 70 |
//Clean some sections |
91 | 71 |
//$article_only = re_remove($article_only, '//'); |
92 | 72 |
$article_only = re_remove($article_only, '/<div id="(.+?)-slug" class="ResponsiveAd-(.+?)"><p>Advertisement<\/p><\/div>/'); |
... | ... |
@@ -1,8 +1,7 @@ |
1 | 1 |
<?php |
2 | 2 |
include_once( 'news-constants.php' ); |
3 | 3 |
|
4 |
-//$rss_content = file_get_contents(NEWS_RSS_WAPO); |
|
5 |
-$rss_content = file_get_contents('https://sg.kawi.fr/feed-wapo.xml'); |
|
4 |
+$rss_content = file_get_contents(NEWS_RSS_WAPO); |
|
6 | 5 |
$orgStrings = array( 'media:thumbnail'); |
7 | 6 |
$newStrings = array( 'mediacontent'); |
8 | 7 |
$rss_content = str_replace($orgStrings, $newStrings, $rss_content); |
... | ... |
@@ -75,7 +74,7 @@ foreach ($articles as $article ) { |
75 | 74 |
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> '; |
76 | 75 |
echo '<div id="nav-prev" onclick="onArticle('.$cpt_prev.')" style="display:inline;"><i class="fa fa-chevron-left fa-2x"></i></div> '; |
77 | 76 |
echo '<div id="nav-next" onclick="onArticle('.$cpt_next.')" style="display:inline;"><i class="fa fa-chevron-right fa-2x"></i></div>'; |
78 |
- echo '<div class="extract-content" id="'.$cpt.'">'.$article_only.'</div>'; |
|
77 |
+ echo '<div class="extract-content" id="'.$cpt.'">'."<h1>".$article['title']."</h1>".$article_only.'</div>'; |
|
79 | 78 |
echo '<div id="nav-up" style="display:inline;"><a href="#top"><i class="fa fa-home fa-2x"></i></a></div> '; |
80 | 79 |
echo '<div id="nav-up" style="display:inline;"><a href="#article-top"><i class="fa fa-chevron-up fa-2x"></i></a></div> '; |
81 | 80 |
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> '; |