From 9124ed640e54000227bf0d752318756267873128 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 17 Feb 2017 20:04:38 +0100 Subject: [PATCH] [WebfailBridge] Properly handle gifs (DOM changed) --- bridges/WebfailBridge.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bridges/WebfailBridge.php b/bridges/WebfailBridge.php index 4671122..68ceffa 100644 --- a/bridges/WebfailBridge.php +++ b/bridges/WebfailBridge.php @@ -99,14 +99,14 @@ class WebfailBridge extends BridgeAbstract { $item = array(); $item['title'] = $this->fixTitle($article->find('a', 1)->innertext); - // Webfail shares videos or images + // Images, videos and gifs are provided in their own unique way if(!is_null($article->find('img.wf-image', 0))){ // Image type $item['uri'] = $this->getURI() . $article->find('a', 2)->href; $item['content'] = ''; + . '">'; } elseif(!is_null($article->find('div.wf-video', 0))){ // Video type $videoId = $this->getVideoId($article->find('div.wf-play', 0)->onclick); $item['uri'] = 'https://youtube.com/watch?v=' . $videoId; @@ -115,6 +115,13 @@ class WebfailBridge extends BridgeAbstract { . '">'; + } elseif(!is_null($article->find('video[id*=gif-]', 0))){ // Gif type + $item['uri'] = $this->getURI() . $article->find('a', 2)->href; + $item['content'] = ''; } $this->items[] = $item;