forked from blallo/rss-bridge
Corrected PinterestBridge.
This commit is contained in:
parent
ca2951df30
commit
f09dedf16b
1 changed files with 11 additions and 6 deletions
|
@ -51,7 +51,8 @@ class PinterestBridge extends BridgeAbstract{
|
||||||
|
|
||||||
$this->username = $param['u'];
|
$this->username = $param['u'];
|
||||||
$this->board = $param['b'];
|
$this->board = $param['b'];
|
||||||
$html = file_get_html($this->getURI().'/'.urlencode($this->username).'/'.urlencode($this->board)) or $this->returnError('Could not request Pinterest.', 404);
|
$html = file_get_html($this->getURI().'/'.urlencode($this->username).'/'.urlencode($this->board)) or $this->returnError('Username and/or board not found', 404);
|
||||||
|
|
||||||
} else if (isset($param['q']))
|
} else if (isset($param['q']))
|
||||||
{
|
{
|
||||||
$this->query = $param['q'];
|
$this->query = $param['q'];
|
||||||
|
@ -76,13 +77,17 @@ class PinterestBridge extends BridgeAbstract{
|
||||||
|
|
||||||
if (isset($this->query))
|
if (isset($this->query))
|
||||||
{
|
{
|
||||||
$avatar = $div->find('img.creditImg', 0);
|
$avatar = $div->find('div.creditImg', 0)->find('img', 0);
|
||||||
$username = $div->find('span.creditName', 0);
|
$avatar = $avatar->getAttribute('data-src');
|
||||||
$board = $div->find('span.creditTitle', 0);
|
$avatar = str_replace("\\", "", $avatar);
|
||||||
|
|
||||||
|
|
||||||
|
$username = $div->find('div.creditName', 0);
|
||||||
|
$board = $div->find('div.creditTitle', 0);
|
||||||
|
|
||||||
$item->username =$username->innertext;
|
$item->username =$username->innertext;
|
||||||
$item->fullname = $board->innertext;
|
$item->fullname = $board->innertext;
|
||||||
$item->avatar = $avatar->getAttribute('src');
|
$item->avatar = $avatar;
|
||||||
|
|
||||||
$item->content .= '<br /><img align="left" style="margin: 2px 4px;" src="'.htmlentities($item->avatar).'" /> <strong>'.$item->username.'</strong>';
|
$item->content .= '<br /><img align="left" style="margin: 2px 4px;" src="'.htmlentities($item->avatar).'" /> <strong>'.$item->username.'</strong>';
|
||||||
$item->content .= '<br />'.$item->fullname;
|
$item->content .= '<br />'.$item->fullname;
|
||||||
|
@ -111,6 +116,6 @@ class PinterestBridge extends BridgeAbstract{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCacheDuration(){
|
public function getCacheDuration(){
|
||||||
return 3600;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue