[Pinterest] Move all existing code into 'From search' section
'By username and board' requires a different search algorithm
This commit is contained in:
parent
c1cc4da8ef
commit
f8e0a4afbc
1 changed files with 13 additions and 13 deletions
|
@ -36,17 +36,18 @@ class PinterestBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->queriedContext === 'From search'){
|
||||||
foreach($html->find('div.pinWrapper') as $div){
|
foreach($html->find('div.pinWrapper') as $div){
|
||||||
|
$item = array();
|
||||||
|
|
||||||
$a = $div->find('a.pinImageWrapper', 0);
|
$a = $div->find('a.pinImageWrapper', 0);
|
||||||
$img = $a->find('img', 0);
|
$img = $a->find('img', 0);
|
||||||
|
|
||||||
$item = array();
|
|
||||||
$item['uri'] = $this->getURI() . $a->getAttribute('href');
|
$item['uri'] = $this->getURI() . $a->getAttribute('href');
|
||||||
$item['content'] = '<img src="'
|
$item['content'] = '<img src="'
|
||||||
. htmlentities(str_replace('/236x/', '/736x/', $img->getAttribute('src')))
|
. htmlentities(str_replace('/236x/', '/736x/', $img->getAttribute('src')))
|
||||||
. '" alt="" />';
|
. '" alt="" />';
|
||||||
|
|
||||||
if($this->queriedContext === 'From search'){
|
|
||||||
$avatar = $div->find('div.creditImg', 0)->find('img', 0);
|
$avatar = $div->find('div.creditImg', 0)->find('img', 0);
|
||||||
$avatar = $avatar->getAttribute('data-src');
|
$avatar = $avatar->getAttribute('data-src');
|
||||||
$avatar = str_replace("\\", "", $avatar);
|
$avatar = str_replace("\\", "", $avatar);
|
||||||
|
@ -65,13 +66,12 @@ class PinterestBridge extends BridgeAbstract {
|
||||||
. '</strong>'
|
. '</strong>'
|
||||||
. '<br />'
|
. '<br />'
|
||||||
. $item['fullname'];
|
. $item['fullname'];
|
||||||
}
|
|
||||||
|
|
||||||
$item['title'] = $img->getAttribute('alt');
|
$item['title'] = $img->getAttribute('alt');
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getURI(){
|
public function getURI(){
|
||||||
switch($this->queriedContext){
|
switch($this->queriedContext){
|
||||||
|
|
Loading…
Reference in a new issue