mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
bridges: use BridgeAbstract::getSimpleHTMLDOM
instead of BridgeAbstract::file_get_html Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
f43bbda83e
commit
3c0d13c1bb
121 changed files with 1212 additions and 396 deletions
|
@ -28,18 +28,18 @@ class WhydBridge extends BridgeAbstract{
|
|||
{
|
||||
$this->request = $param['u'];
|
||||
if (strlen(preg_replace("/[^0-9a-f]/",'', $this->request)) == 24) { // is input the userid ?
|
||||
$html = $this->file_get_html('http://www.whyd.com/u/'.preg_replace("/[^0-9a-f]/",'', $this->request)) or $this->returnServerError('No results for this query.');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.whyd.com/u/'.preg_replace("/[^0-9a-f]/",'', $this->request)) or $this->returnServerError('No results for this query.');
|
||||
} else { // input may be the username
|
||||
$html = $this->file_get_html('http://www.whyd.com/search?q='.urlencode($this->request)) or $this->returnServerError('No results for this query.');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.whyd.com/search?q='.urlencode($this->request)) or $this->returnServerError('No results for this query.');
|
||||
for ($j = 0; $j < 5; $j++) {
|
||||
if (strtolower($html->find('div.user', $j)->find('a',0)->plaintext) == strtolower($this->request)) {
|
||||
$html = $this->file_get_html('http://www.whyd.com' . $html->find('div.user', $j)->find('a', 0)->getAttribute('href')) or $this->returnServerError('No results for this query');
|
||||
$html = $this->getSimpleHTMLDOM('http://www.whyd.com' . $html->find('div.user', $j)->find('a', 0)->getAttribute('href')) or $this->returnServerError('No results for this query');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->name = $html->find('div#profileTop', 0)->find('h1', 0)->plaintext;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->returnClientError('You must specify username');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue