From b0ce5bdc81f69927edfd33995457f800c6174c13 Mon Sep 17 00:00:00 2001 From: 16mhz Date: Tue, 22 Jul 2014 17:18:31 +0200 Subject: [PATCH 1/2] Humble Store bridge now with thumbnail --- bridges/HumbleStoreDiscountBridge.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 bridges/HumbleStoreDiscountBridge.php diff --git a/bridges/HumbleStoreDiscountBridge.php b/bridges/HumbleStoreDiscountBridge.php old mode 100644 new mode 100755 index 4bcea233..7d109e02 --- a/bridges/HumbleStoreDiscountBridge.php +++ b/bridges/HumbleStoreDiscountBridge.php @@ -29,10 +29,12 @@ class HumbleStoreDiscountBridge extends BridgeAbstract{ $product_uri = $store_link . $value['machine_name']; $platforms = str_replace('\'', '', implode("','", $value['platforms'])); $delivery_methods = str_replace('\'', '', implode("','", $value['delivery_methods'])); + $thumbnail = 'https://www.humblebundle.com' . $value['storefront_featured_image_small']; - $content = '' . $product_name . '
Current price: ' . $new_price . '
Full price: ' . $full_price - . '
Delivery methods: ' . $delivery_methods . '
Platforms: ' - . $platforms . '
' . $value['description']; + $content = '' . $value['storefront_featured_image_small'] . '

' . $product_name + . '

Current price: ' . $new_price . '
Full price: ' . $full_price + . '
Developer: ' . $value['developer_name'] . '
Delivery methods: ' . $delivery_methods + . '
Platforms: ' . $platforms . '
' . $value['description']; $item = new \Item(); $item->title = $product_name . ' - ' . $new_price; @@ -56,4 +58,3 @@ class HumbleStoreDiscountBridge extends BridgeAbstract{ return 21600; // 6 hours } } - From 5714892115640d03c2d6a02c5ce96f2ac9b31e9a Mon Sep 17 00:00:00 2001 From: 16mhz Date: Tue, 22 Jul 2014 17:20:43 +0200 Subject: [PATCH 2/2] Add: New bridge for LeBonCoin with region filter --- bridges/LeBonCoinBridge.php | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 bridges/LeBonCoinBridge.php diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php new file mode 100755 index 00000000..e895bc2c --- /dev/null +++ b/bridges/LeBonCoinBridge.php @@ -0,0 +1,61 @@ +returnError('Could not request LeBonCoin.', 404); + + $list = $html->find('.list-lbc', 0); + $tags = $list->find('a'); + + foreach($tags as $element) { + $item = new \Item(); + $item->uri = $element->href; + $title = $element->getAttribute('title'); + + $content = 'thumbnail'; + $date = $element->find('div.date', 0)->find('div', 0) . $element->find('div.date', 0)->find('div', 1) . '
'; + $detailsList = $element->find('div.detail', 0); + + for ($i = 1; $i < 4; $i++) { + $line = $detailsList->find('div', $i); + $content .= $line; + } + + $item->title = $title . ' - ' . $detailsList->find('div', 3); + $item->content = $content . $date; + $this->items[] = $item; + } + } + + public function getName(){ + return 'LeBonCoin'; + } + + public function getURI(){ + return 'http://www.leboncoin.fr'; + } + + public function getCacheDuration(){ + return 3600; // 1 hour + } +}