| ... | ... |
@@ -63,6 +63,22 @@ foreach ($articles as $article ) {
|
| 63 | 63 |
foreach ( $articles as $node) {
|
| 64 | 64 |
$article_only = DOMinnerHTML($node); |
| 65 | 65 |
} |
| 66 |
+ |
|
| 67 |
+ $SEARCH_SUB='<span class="ea_article">édition abonné</span>'; |
|
| 68 |
+ $pos_start=strpos($article_content, $SEARCH_SUB); |
|
| 69 |
+ if($pos_start) {
|
|
| 70 |
+ $article_abonne = str_replace("www.lemonde.fr", "abonnes.lemonde.fr", $article['link']);
|
|
| 71 |
+ $article_content = file_get_contents($article_abonne); |
|
| 72 |
+ $doc = new DOMDocument(); |
|
| 73 |
+ $doc->preserveWhiteSpace = false; |
|
| 74 |
+ $doc->formatOutput = true; |
|
| 75 |
+ $doc->loadHTML($article_content); |
|
| 76 |
+ $articles = $doc->getElementsByTagName('article');
|
|
| 77 |
+ $article_only=""; |
|
| 78 |
+ foreach ( $articles as $node) {
|
|
| 79 |
+ $article_only = DOMinnerHTML($node); |
|
| 80 |
+ } |
|
| 81 |
+ } |
|
| 66 | 82 |
|
| 67 | 83 |
$orgStrings = array(' href="/');
|
| 68 | 84 |
$newStrings = array(' href="https://www.lemonde.fr/');
|