From 6c1d8615292317b0110a56a4c20bafc00b9c7189 Mon Sep 17 00:00:00 2001 From: Lorenzo Stanco Date: Wed, 26 Dec 2018 20:32:44 +0100 Subject: [PATCH] [InstagramBridge] Add link on image and video indication in title (#966) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In item content, the image is now a clickable link to the post; In item title a ▶ is prepended if the post contains a video; it's impossible to tell from the content image. --- bridges/InstagramBridge.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php index 4abec001..37b2de84 100644 --- a/bridges/InstagramBridge.php +++ b/bridges/InstagramBridge.php @@ -88,7 +88,7 @@ class InstagramBridge extends BridgeAbstract { $textContent = basename($media->display_url); } - $item['title'] = trim($textContent); + $item['title'] = ($media->is_video ? '▶ ' : '') . trim($textContent); $titleLinePos = strpos(wordwrap($item['title'], 120), "\n"); if ($titleLinePos != false) { $item['title'] = substr($item['title'], 0, $titleLinePos) . '...'; @@ -99,8 +99,9 @@ class InstagramBridge extends BridgeAbstract { $item['content'] = $data[0]; $item['enclosures'] = $data[1]; } else { - $item['content'] = '' . $item['title'] . ''; - $item['content'] .= '

' . nl2br(htmlentities($textContent)); + $item['content'] = ''; + $item['content'] .= '' . $item['title'] . ''; + $item['content'] .= '

' . nl2br(htmlentities($textContent)); $item['enclosures'] = array($media->display_url); }