From c6ce453c47aaeec95624c30630257fcfd89ccdfa Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 19 Mar 2017 12:04:59 +0100 Subject: [PATCH] [MixCloudBridge] Fix bridge broken after DOM changed This commit fixes DOM changes reported via #436 New DOM introduced via https://blog.mixcloud.com/2017/01/10/take-a-look-at-the-new-and-improved-mixcloud/ --- bridges/MixCloudBridge.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bridges/MixCloudBridge.php b/bridges/MixCloudBridge.php index 04fbb967..073cdf2c 100644 --- a/bridges/MixCloudBridge.php +++ b/bridges/MixCloudBridge.php @@ -25,26 +25,26 @@ class MixCloudBridge extends BridgeAbstract { public function collectData(){ - $html = getSimpleHTMLDOM(self::URI . '/' . $this->getInput('u')) + $html = getSimpleHTMLDOM(self::URI . $this->getInput('u')) or returnServerError('Could not request MixCloud.'); - foreach($html->find('div.card-elements-container') as $element){ + foreach($html->find('section.card') as $element){ $item = array(); - $item['uri'] = self::URI . $element->find('h3.card-cloudcast-title a', 0)->getAttribute('href'); + $item['uri'] = self::URI . $element->find('hgroup.card-title h1 a', 0)->getAttribute('href'); $item['title'] = html_entity_decode( - $element->find('h3.card-cloudcast-title a span', 0)->getAttribute('title'), + $element->find('hgroup.card-title h1 a span', 0)->getAttribute('title'), ENT_QUOTES ); - $image = $element->find('img.image-for-cloudcast', 0); + $image = $element->find('a.album-art img', 0); if($image){ $item['content'] = ''; } - $item['author'] = trim($element->find('h4.card-cloudcast-user a', 0)->innertext); + $item['author'] = trim($element->find('hgroup.card-title h2 a', 0)->innertext); $this->items[] = $item; }