Skip to content

Commit

Permalink
[DribbbleBridge] Fix picture parsing (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
corenting committed Oct 9, 2020
1 parent 84d5daa commit 82acbbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bridges/DribbbleBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getIcon() {
}

public function collectData(){
$html = getSimpleHTMLDOM(self::URI . '/shots')
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Error while downloading the website content');

$json = $this->loadEmbeddedJsonData($html);
Expand All @@ -36,7 +36,7 @@ public function collectData(){
$description = $shot->find('.comment', 0);
$item['content'] = $description === null ? '' : $description->plaintext;

$preview_path = $shot->find('picture source', 0)->attr['srcset'];
$preview_path = $shot->find('figure img', 1)->attr['data-srcset'];
$item['content'] .= $this->getImageTag($preview_path, $item['title']);
$item['enclosures'] = array($this->getFullSizeImagePath($preview_path));

Expand Down Expand Up @@ -94,6 +94,6 @@ private function getImageTag($preview_path, $title){
}

private function getFullSizeImagePath($preview_path){
return str_replace('_1x', '', $preview_path);
return explode("?compress=1", $preview_path)[0];
}
}

0 comments on commit 82acbbb

Please sign in to comment.