diff --git a/bridges/UrlebirdBridge.php b/bridges/UrlebirdBridge.php index 2483e202..6e1b4b14 100644 --- a/bridges/UrlebirdBridge.php +++ b/bridges/UrlebirdBridge.php @@ -19,6 +19,12 @@ class UrlebirdBridge extends BridgeAbstract { private $title; + private function fixURI($uri) { + $path = parse_url($uri, PHP_URL_PATH); + $encoded_path = array_map('urlencode', explode('/', $path)); + return str_replace($path, implode('/', $encoded_path), $uri); + } + public function collectData() { switch($this->getInput('query')[0]) { default: @@ -37,7 +43,7 @@ class UrlebirdBridge extends BridgeAbstract { $articles = $html->find('div.thumb'); foreach ($articles as $article) { $item = array(); - $item['uri'] = $article->find('a', 2)->href; + $item['uri'] = $this->fixURI($article->find('a', 2)->href); $article_content = getSimpleHTMLDOM($item['uri']); $item['author'] = $article->find('img', 0)->alt . ' (' . $article_content->find('a.user-video', 1)->innertext . ')'; @@ -48,7 +54,9 @@ class UrlebirdBridge extends BridgeAbstract { $item['content'] = $video->outertext . '
' . $article_content->find('div.music', 0) . '
' . $article_content->find('div.info2', 0)->innertext . - '

Video link'; + '

Direct video link

Post link

'; $this->items[] = $item; } }