From 8e44a01b2abab5b1876ebbc6890d880b9f3dbf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Parisot?= Date: Wed, 4 Feb 2015 14:05:34 +0100 Subject: [PATCH 1/2] Fix LesJoiesDuCode / TheCodingLove bridges Retrieve the .gif instead of the static .jpg that is now in the HTML source --- bridges/LesJoiesDuCodeBridge.php | 9 ++++++++- bridges/TheCodingLoveBridge.php | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php index 0550d23..25ff3f3 100644 --- a/bridges/LesJoiesDuCodeBridge.php +++ b/bridges/LesJoiesDuCodeBridge.php @@ -4,7 +4,7 @@ * @name Les Joies Du Code * @homepage http://lesjoiesducode.fr/ * @description LesJoiesDuCode -* @update 30/01/2014 +* @update 04/02/2015 * initial maintainer: superbaillot.net */ class LesJoiesDuCodeBridge extends BridgeAbstract{ @@ -20,6 +20,13 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ $url = $temp->href; $temp = $element->find('div.bodytype', 0); + + // retrieve .gif instead of static .jpg + $images = $temp->find('p.e img'); + foreach($images as $image){ + $img_src = str_replace(".jpg",".gif",$image->src); + $image->src = $img_src; + } $content = $temp->innertext; $auteur = $temp->find('.c1 em', 0); diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php index 68a73c6..de5f910 100644 --- a/bridges/TheCodingLoveBridge.php +++ b/bridges/TheCodingLoveBridge.php @@ -4,7 +4,7 @@ * @name The Coding Love * @homepage http://thecodinglove.com/ * @description The Coding Love -* @update 30/01/2014 +* @update 04/02/2015 * initial maintainer: superbaillot.net */ class TheCodingLoveBridge extends BridgeAbstract{ @@ -20,8 +20,15 @@ class TheCodingLoveBridge extends BridgeAbstract{ $url = $temp->href; $temp = $element->find('div.bodytype', 0); - $content = $temp->innertext; + // retrieve .gif instead of static .jpg + $images = $temp->find('p.e img'); + foreach($images as $image){ + $img_src = str_replace(".jpg",".gif",$image->src); + $image->src = $img_src; + } + $content = $temp->innertext; + $auteur = $temp->find('.c1 em', 0); $pos = strpos($auteur->innertext, "by"); From 25bc28508388161b340c17d88fd0b0f141bc1e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Parisot?= Date: Sat, 7 Feb 2015 22:47:17 +0100 Subject: [PATCH 2/2] LesJoiesDuCode/TheCodingLove: Fix author format --- bridges/LesJoiesDuCodeBridge.php | 2 +- bridges/TheCodingLoveBridge.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php index 25ff3f3..4ccc9d0 100644 --- a/bridges/LesJoiesDuCodeBridge.php +++ b/bridges/LesJoiesDuCodeBridge.php @@ -29,7 +29,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{ } $content = $temp->innertext; - $auteur = $temp->find('.c1 em', 0); + $auteur = $temp->find('i', 0); $pos = strpos($auteur->innertext, "by"); if($pos > 0) diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php index de5f910..387adec 100644 --- a/bridges/TheCodingLoveBridge.php +++ b/bridges/TheCodingLoveBridge.php @@ -29,7 +29,7 @@ class TheCodingLoveBridge extends BridgeAbstract{ } $content = $temp->innertext; - $auteur = $temp->find('.c1 em', 0); + $auteur = $temp->find('i', 0); $pos = strpos($auteur->innertext, "by"); if($pos > 0)