diff --git a/bridges/PinterestBridge.php b/bridges/PinterestBridge.php index 4907f40..59bbf12 100644 --- a/bridges/PinterestBridge.php +++ b/bridges/PinterestBridge.php @@ -68,6 +68,28 @@ class PinterestBridge extends BridgeAbstract { . $item['fullname']; $item['title'] = $img->getAttribute('alt'); + $this->items[] = $item; + } + } elseif($this->queriedContext === 'By username and board'){ + $container = $html->find('SCRIPT[type="application/ld+json"]', 0) + or $this->returnServerError('Unable to find data container!'); + + $json = json_decode($container->innertext, true); + + foreach($json['itemListElement'] as $element){ + $item = array(); + + $item['uri'] = $element['item']['sharedContent']['author']['url']; + $item['title'] = $element['item']['name']; + $item['author'] = $element['item']['user']['name']; + $item['timestamp'] = strtotime($element['item']['datePublished']); + $item['content'] = << + + +

{$element['item']['text']}

+EOD; + $this->items[] = $item; } }