diff --git a/bridges/AskfmBridge.php b/bridges/AskfmBridge.php index 6de8f54f..7a8b9e21 100644 --- a/bridges/AskfmBridge.php +++ b/bridges/AskfmBridge.php @@ -15,13 +15,12 @@ class AskfmBridge extends BridgeAbstract{ ); public function collectData(){ - $html = ''; $html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Requested username can\'t be found.'); foreach($html->find('div.streamItem-answer') as $element) { $item = array(); - $item['uri'] = 'http://ask.fm'.$element->find('a.streamItemsAge',0)->href; + $item['uri'] = $this->uri.$element->find('a.streamItemsAge',0)->href; $question = trim($element->find('h1.streamItemContent-question',0)->innertext); $item['title'] = trim(htmlspecialchars_decode($element->find('h1.streamItemContent-question',0)->plaintext, ENT_QUOTES)); $answer = trim($element->find('p.streamItemContent-answer',0)->innertext); @@ -36,7 +35,7 @@ class AskfmBridge extends BridgeAbstract{ } $content = '

' . $question . '

' . $answer . '

' . $visual . '

'; // Fix relative links without breaking // scheme used by YouTube stuff - $content = preg_replace('#href="\/(?!\/)#', 'href="http://ask.fm/',$content); + $content = preg_replace('#href="\/(?!\/)#', 'href="'.$this->uri,$content); $item['content'] = $content; $this->items[] = $item; }