function fetchSearch($type) { $template = new HdboxTemplate(); $content = file_get_contents("http://hd-box.org/index.php?searchword=" . $type . "&ordering=&searchphrase=all&option=com_search"); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8")); preg_match_all("/<\\/span><a href=\"(.*)\">(.*)<\\/a><\\/div>/U", $content, $results, PREG_SET_ORDER); if ($results) { foreach ($results as $link) { $template->addItem(utf8_decode($link[2]), "", SCRAPER_URL . "index.php?title=" . base64_encode($link[2]) . URL_AMP . "item=" . base64_encode($link[1]), ""); } } $template->generateView(HdboxTemplate::VIEW_MOVIE, ""); }
function fetchSearch($type, $context) { $template = new HdboxTemplate(); $content = getContent("hd-box.org", "/index.php?searchword=" . $type . "&ordering=&searchphrase=all&option=com_search"); preg_match_all("/<\\/span><a href=\"(.*)\">(.*)<\\/a><\\/div>/U", $content, $results, PREG_SET_ORDER); if ($results) { foreach ($results as $link) { $template->addItem(utf8_decode($link[2]), "", SCRAPER_URL . "index.php?title=" . base64_encode($link[2]) . URL_AMP . "item=" . base64_encode($link[1]), ""); } } $template->generateView(HdboxTemplate::VIEW_MOVIE, ""); }