From 52dfa3fe76784b71f029387b095536e58c53bfe4 Mon Sep 17 00:00:00 2001 From: sysadminstory Date: Sun, 11 Mar 2018 15:38:07 +0100 Subject: [PATCH] [RadioMelodieBridge] Add new bridge (#640) --- bridges/RadioMelodieBridge.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 bridges/RadioMelodieBridge.php diff --git a/bridges/RadioMelodieBridge.php b/bridges/RadioMelodieBridge.php new file mode 100644 index 0000000..9b3772b --- /dev/null +++ b/bridges/RadioMelodieBridge.php @@ -0,0 +1,30 @@ +find('div[class=actuitem]'); + foreach($list as $element) { + $item = array(); + + // Get picture URL + $pictureHTML = $element->find('div[class=picture]'); + preg_match( + '/background-image:url\((.*)\);/', + $pictureHTML[0]->getAttribute('style'), + $pictures); + $pictureURL = $pictures[1]; + + $item['enclosures'] = array($pictureURL); + $item['uri'] = self::URI . $element->parent()->href; + $item['title'] = $element->find('h3', 0)->plaintext; + $item['content'] = $element->find('p', 0)->plaintext . '
'; + $this->items[] = $item; + } + } +}