function testSearchStarWars() { // Star Wars // http://www.dvdfr.com/api/search.php?title=star%20wars // Result: XML with many results $search = 'star wars'; $data = engineSearch($search, 'dvdfr'); #dump($data); #$this->assertNoErrors(); // Results // - More than 5 // - Contain // 7919 (Star Wars - Episode I - La menace fantome) // 11092 (Star Wars - Episode II - L'attaque des clones) // 6504 (Star Wars - Episode III - La revanche des Sith) // 663 (Star Wars - Episode IV - Un nouvel espoir) // 492 (Star Wars - Episode V - L'Empire contre-attaque) // 1250 (Star Wars - Episode VI - Le retour du Jedi) $obj = array('dvdfr:7919', 'dvdfr:11092', 'dvdfr:6504', 'dvdfr:663', 'dvdfr:492', 'dvdfr:1250'); $this->assertTrue(sizeof($data) > 0); // Search each movie in result foreach ($obj as $search) { $f = 0; foreach ($data as $movie) { if ($search == $movie['id']) { $f = 1; } } $this->assertTrue($f); } }
function testSearch() { $id = 'Grey\'s Anatomy'; $data = engineSearch($id, 'isohunt'); #$this->assertNoErrors(); $this->assertTrue(sizeof($data) >= 1); # dump($data); }
function testSearch() { $id = 'Star Wars: Episode 1'; $data = engineSearch($id, 'amazonaws', 'DVD', 'com'); #$this->assertNoErrors(); $this->assertTrue(sizeof($data) > 0); # dump($data); }
function testSearch2() { // http://images.google.com/images?q=Out+of+Time $id = 'Out of Time'; $data = engineSearch($id, 'google'); #$this->assertNoErrors(); $this->assertTrue(sizeof($data) >= 16); # dump($data); }
function testSearch() { // Clerks 2 // http://www.ofdb.de/film/102676,Clerks-2---Die-Abh%C3%A4nger $data = engineSearch('Clerks 2', 'ofdb'); # dump($data); $this->assertTrue(sizeof($data) > 3); $data = $data[4]; $this->assertEqual($data[imdbID], 'ofdb:102676'); $this->assertEqual($data[title], 'Clerks 2'); $this->assertPattern('/Die Abhänger/', $data[subtitle]); }
/** * Make sure matching is correct and no HTML tags are included */ function testPartialSearch() { // Serpico // http://imdb.com/find?s=all&q=serpico $data = engineSearch('Serpico', 'imdb'); #echo("<pre>");dump($data);echo("</pre>"); foreach ($data as $item) { $t = strip_tags($item['title']); $this->assertTrue($item['title'] == $t); } }
$data['actors'] = $data['cast']; $data['imgurl'] = $data['coverurl']; } /* // load languages and config into Smarty tpl_language(); tpl_edit($data); $content = $smarty->fetch('edit.tpl'); # file_append('log.txt', $content); echo $content; */ exit; } // use subtitle for aka search $data = $ajax_autocomplete_title ? engineSearch($ajax_autocomplete_title, engineGetDefault()) : engineSearch($ajax_autocomplete_subtitle, engineGetDefault(), true); if ($ajax_type == 'json') { # file_append('log.txt', $res); header("Content-Type: application/json"); echo json_encode($data); exit; } foreach ($data as $item) { $text = preg_replace('/(' . $ajax_autocomplete_title . ')/i', '<em>\\1</em>', $item['title']); $text .= $item['year'] ? "<span class='informal'> (" . $item['year'] . ")</span>" : ''; $ret .= "<li id='" . $item['id'] . "'>" . $text . "</li>"; } $ret = "<ul>{$ret}</ul>"; exit($ret); } // duplicate check
$result = engineSearch($find, $engine, $catalog); $searchurl = engineGetSearchUrl($find, $engine); } break; case 'imdb': // imdb $smarty->assign('searchaka', $searchaka); if (!empty($find)) { $result = engineSearch($find, $engine, $searchaka); $searchurl = engineGetSearchUrl($find, $engine); } break; default: // tvcom, amazon, google if (!empty($find)) { $result = engineSearch($find, $engine); $searchurl = engineGetSearchUrl($find, $engine); } } $smarty->assign('searchtype', $searchtype); $smarty->assign('imdbresults', $result); // process asynchronous refresh if ($ajax_render) { ajax_render(); } // prepare templates tpl_language(); tpl_header(); // prepare template with selected and available engines tpl_lookup($find, $engine, $searchtype); $smarty->assign('searchurl', $searchurl);
//get seen field from form $seen = isset($_POST['seen']) ? 1 : 0; //get mediatype id from form $mediatype = $_POST['mediatype']; $lines = file($filename); //iterate for all lines in uploaded file foreach ($lines as $line) { //trim \n from end of line $line = rtrim($line); //if line is empty, go to the next line if ($line == "") { continue; } //if we import by title, first get id from best matcing title if ($_POST['import_type'] == 'title') { $all = engineSearch($line); $id = $all[0][id]; } else { $id = $line; } if (strpos($id, "imdb:") === false) { $id = "imdb:" . $id; } //try to insert movie if (InsertMovie($id, &$title, $seen, $mediatype) == 1) { echo "<a href=\"http://www.imdb.com/title/tt" . substr($id, -7) . "/\">{$title}</a> inserted "; if ($_POST['import_type'] == 'title') { echo "(additional info - title form file was {$line})"; } echo "<br>"; } else {