diff options
author | Thorsten Ortlepp <post@ortlepp.eu> | 2021-11-14 15:15:56 +0100 |
---|---|---|
committer | Thorsten Ortlepp <post@ortlepp.eu> | 2021-11-14 15:15:56 +0100 |
commit | 879c9529a19ad446ceca9b1bc45e560093d39801 (patch) | |
tree | fcee63ca6f25106083bdc773de4230601d6bba3e | |
parent | 56a86a1877c2d7dbc293c825a3cd606baad8e24b (diff) | |
download | php-stuff-879c9529a19ad446ceca9b1bc45e560093d39801.zip |
Fix parsing due to website changes
-rw-r--r-- | feed2podcast/feed2podcast.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/feed2podcast/feed2podcast.php b/feed2podcast/feed2podcast.php index 468aee8..782dcac 100644 --- a/feed2podcast/feed2podcast.php +++ b/feed2podcast/feed2podcast.php @@ -128,14 +128,15 @@ function getPageContent($site) { $dom = new DomDocument(); $dom->loadHTML(download($site)); $xpath = new DOMXpath($dom); - $player = $xpath->query("//a[@class='player-embed']"); - $author = $xpath->query("//p[@class='author']"); + $player = $xpath->query("//button[@data-audio-series='Kalenderblatt']"); + $author = $xpath->query("//p[@class='article-header-author']"); if ($player->length == 0) { return array('XXX'); } $authorname = str_replace('Von ', '', $author->item(0)->nodeValue); + $authorname = trim(substr($authorname , 0, strpos($authorname, '|'))); $minutes = intdiv(intval($player->item(0)->getAttribute('data-audio-duration')), 60); $seconds = intval($player->item(0)->getAttribute('data-audio-duration')) % 60; |