Skip to content

Commit

Permalink
[InstagramBridge] Fix image link
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzos authored and teromene committed Apr 20, 2019
1 parent 8f5151b commit 7b8dd93
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bridges/InstagramBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function collectData(){
if (isset($media->edge_media_to_caption->edges[0]->node->text)) {
$textContent = $media->edge_media_to_caption->edges[0]->node->text;
} else {
$textContent = basename($media->display_url);
$textContent = '(no text)';
}

$item['title'] = ($media->is_video ? '▶ ' : '') . trim($textContent);
Expand All @@ -103,10 +103,11 @@ public function collectData(){
$item['content'] = $data[0];
$item['enclosures'] = $data[1];
} else {
$mediaURI = self::URI . 'p/' . $media->shortcode . '/media?size=l';
$item['content'] = '<a href="' . htmlentities($item['uri']) . '" target="_blank">';
$item['content'] .= '<img src="' . htmlentities($media->display_url) . '" alt="' . $item['title'] . '" />';
$item['content'] .= '<img src="' . htmlentities($mediaURI) . '" alt="' . $item['title'] . '" />';
$item['content'] .= '</a><br><br>' . nl2br(htmlentities($textContent));
$item['enclosures'] = array($media->display_url);
$item['enclosures'] = array($mediaURI);
}

$item['timestamp'] = $media->taken_at_timestamp;
Expand Down

0 comments on commit 7b8dd93

Please sign in to comment.