mainURL = "www.mininova.org"; $this->altURL = "www.mininova.org"; $this->mainTitle = "mininova"; $this->engineName = "mininova"; $this->author = "sloan"; $this->version = "1.01-tfb"; $this->updateURL = "http://www.torrentflux.com/forum/index.php/topic,1501.0.html"; $this->Initialize($cfg); } function populateMainCategories() { $this->mainCatalog[0] = "(all types)"; $this->mainCatalog[1] = "Anime"; $this->mainCatalog[2] = "Books"; $this->mainCatalog[3] = "Games"; $this->mainCatalog[4] = "Movies"; $this->mainCatalog[5] = "Music"; $this->mainCatalog[6] = "Other"; $this->mainCatalog[7] = "Pictures"; $this->mainCatalog[8] = "Software"; $this->mainCatalog[9] = "TV Shows"; } //---------------------------------------------------------------- // Function to Make the Request (overriding base) function makeRequest($request) { return parent::makeRequest($request, true); } //---------------------------------------------------------------- // Function to get Latest.. function getLatest() { $request = "/latest.php?mode=bt"; if (!empty($this->pg)) { $request .= "&pg=" . $this->pg; } if ($this->makeRequest($request)) { return $this->parseResponse(true); } else { return $this->msg; } } //---------------------------------------------------------------- // Function to perform Search. function performSearch($searchTerm) { // This is what mininova is looking for in a request. // http://www.mininova.org/search/?search=test // create the request string. $searchTerm = str_replace(" ", "+", $searchTerm); $request = "/search/$searchTerm/seeds"; if (!empty($this->pg)) { $request .= "&ihs1=18&iho1=d&iht=-1&ihp=" . $this->pg; } // make the request if successful call the parse routine. if ($this->makeRequest($request)) { return $this->parseResponse(false); } else { return $this->msg; } } //---------------------------------------------------------------- // Function to parse the response. function parseResponse($latest = true) { $output = $this->tableHeader(); $thing = $this->htmlPage; // Strip out those Nasty Iframes. $thing = preg_replace("//i",'',$thing); // We got a response so display it. // Chop the front end off. $thing = substr($thing,strpos($thing,">Leechers<")); $thing = substr($thing,strpos($thing,"")); // ok so now we have the listing. $tmpListArr = explode("",$tmpList); $bg = $this->cfg["bgLight"]; foreach($tmpListArr as $key =>$value) { //echo $value; $buildLine = true; if (strpos($value,'catFilter); print_r($ts->CatName); print_r("-->"); if ($this->hideSeedless == "yes") { if($ts->Seeds == "---") { $buildLine = false; } } if (!empty($ts->torrentFile) && $buildLine) { $output .= trim($ts->BuildOutput($bg)); // ok switch colors. if ($bg == $this->cfg["bgLight"]) { $bg = $this->cfg["bgDark"]; } else { $bg = $this->cfg["bgLight"]; } } } } // set thing to end of this table. $thing = substr($thing,strpos($thing,"")); $output .= ""; return $output; } } // This is a worker class that takes in a row in a table and parses it. class mininova { var $torrentName = ""; var $torrentDisplayName = ""; var $torrentFile = ""; var $torrentSize = ""; var $torrentStatus = ""; var $CatId = ""; var $CatName = ""; var $fileCount = ""; var $Seeds = ""; var $Peers = ""; var $Data = ""; var $dateAdded = ""; var $dwnldCount = ""; function mininova( $htmlLine , $latest = true) { if (strlen($htmlLine) > 0) { $this->Data = $htmlLine; // Chunck up the row into columns. $tmpListArr = explode("",$htmlLine); array_pop($tmpListArr); //print_r($tmpListArr); //Age Type Torrent Names MB S L if(count($tmpListArr) > 4) { if ($latest) { // Latest Request // $this->CatName = $this->cleanLine($tmpListArr["1"]); // Type $tmpStr = substr($tmpListArr["2"],strpos($tmpListArr["2"],"/tor/")+5); $this->torrentFile = "http://www.mininova.org/get/".substr($tmpStr,0,strpos($tmpStr,'">')); $this->torrentName = $this->cleanLine($tmpListArr["2"]); // Name $this->torrentSize = $this->cleanLine($tmpListArr["3"]); // MB $this->Seeds = $this->cleanLine($tmpListArr["4"]); // Seeds $this->Peers = $this->cleanLine($tmpListArr["5"]); // Leechers } else { // Search Request // $this->CatName = $this->cleanLine($tmpListArr["1"]); // Type $tmpStr = substr($tmpListArr["2"],strpos($tmpListArr["2"],"/tor/")+5); $this->torrentFile = "http://www.mininova.org/get/".substr($tmpStr,0,strpos($tmpStr,'">')); $this->torrentName = $this->cleanLine( substr($tmpListArr[2], strpos($tmpListArr["2"], "torrentSize = $this->cleanLine($tmpListArr["3"]); // MB $this->Seeds = $this->cleanLine($tmpListArr["4"]); // Seeds $this->Peers = $this->cleanLine($tmpListArr["5"]); // Leechers $this->torrentDisplayName = $this->torrentName; } if ($this->Peers == '') { $this->Peers = "N/A"; if (empty($this->Seeds)) $this->Seeds = "N/A"; } if ($this->Seeds == '') $this->Seeds = "N/A"; $this->torrentDisplayName = str_replace(".torrent",'',$this->torrentName); if(strlen($this->torrentDisplayName) > 50) { $this->torrentDisplayName = substr($this->torrentDisplayName,0,50)."..."; } } } } function cleanLine($stringIn,$tags='') { if(empty($tags)) return trim(str_replace(array(" "," ")," ",strip_tags($stringIn))); else return trim(str_replace(array(" "," ")," ",strip_tags($stringIn,$tags))); } function dumpArray($arrIn) { foreach($arrIn as $key => $value) { echo "\nkey(".$key.")"."value(".$value.")"; } } //---------------------------------------------------------------- // Function to build output for the table. function BuildOutput($bg) { $output = "\n"; $output .= " torrentFile."\">torrentName."\" border=0>\n"; $output .= " torrentFile."\" title=\"".$this->torrentName."\">".$this->torrentDisplayName."\n"; $output .= " ". $this->CatName ."\n"; $output .= " ".$this->torrentSize."\n"; $output .= " ".$this->Seeds."\n"; $output .= " ".$this->Peers."\n"; $output .= "\n"; return $output; } } ?>