sReferer!='') curl_setopt($oCurl, CURLOPT_REFERER, $this->sReferer); curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false); //if($bHeader) curl_setopt($oCurl, CURLOPT_FOLLOWLOCATION, true); //Cookies //$sCookies = $this->getCookies(); //if($sCookies!='') curl_setopt($oCurl, CURLOPT_COOKIE, $sCookies); //curl_setopt($oCurl, CURLOPT_COOKIEJAR, $this->fCookieJar); //curl_setopt($oCurl, CURLOPT_COOKIEFILE, $this->fCookieJar); $sContent = curl_exec($oCurl); curl_close($oCurl); //$this->sReferer = $sUrl; return $sContent; } function parseTop10() { $asDesc = array ( 'title'=>'Rarbg RSS Feed', 'link'=>'', 'copyright'=>'Powered by Franzz. RSS Feed Generator under GPLv3 License', 'description'=>'Rarbg RSS Feed', 'language'=>'en', 'webmaster_mail'=>'franzz@gmail.com' ); $oFeed = new Feed($asDesc); $sDomain = 'https://rarbg.to'; $oDom = new DOMDocument(); $sContent = getCurl($sDomain.'/torrents.php?category=14;17;42;44;45;46;47;48&search=&order=seeders&by=DESC'); //$sContent = file_get_contents('test.html'); @$oDom->loadHTML($sContent); $oBody = $oDom->getElementsByTagName('body')->item(0); $aoLines = $oDom->getElementsByTagName('tr'); foreach($aoLines as $oLine) { if($oLine->getAttribute('class')=='lista2') { $asArticle = array(); $aoCols = $oLine->getElementsByTagName('td'); foreach($aoCols as $iIndex=>$oCol) { switch($iIndex) { case 1: $aoLinks = $oCol->getElementsByTagName('a'); foreach($aoLinks as $oLink) { $sHref = $oLink->getAttribute('href'); switch(substr($sHref, 0, 9)) { //Title & link case '/torrent/': $iCount = '|'.$sHref; $asArticle['title'] = $oLink->nodeValue; $sLinkPath = str_replace('#comments', '', $sHref); $asArticle['link'] = $sDomain.$sLinkPath; $asArticle['guid'] = substr($sLinkPath, -7); $sHover = $oLink->getAttribute('onmouseover');//return overlib('') preg_match('/'.preg_quote('src=\\\'').'(?P.+)'.preg_quote('\\\' border').'/', $sHover, $asMatch); $sImg = 'https:'.$asMatch['url']; break; //Author case '/torrents': // /torrents.php?imdb=tt3647498 $sMovieSearchLink = $sHref; break; } } $aoSpans = $oLine->getElementsByTagName('span'); foreach($aoSpans as $oSpan) { if($oSpan->getAttribute('style')=='color:DarkSlateGray') { $sMovieType = $oSpan->nodeValue; $sImdb = strstr($sMovieType, 'IMDB'); $asArticle['category'] = trim(strstr($sMovieType, 'IMDB', true)); } } break; case 2: $asArticle['pub_date'] = $oCol->nodeValue; break; case 3: $sSize = $oCol->nodeValue; break; case 4: $iSeeder = $oCol->nodeValue; break; case 5: $iLeecher = $oCol->nodeValue; break; case 7: $asArticle['author'] = $oCol->nodeValue; break; } } $asArticle['description'] = ''. '
'.$sImdb. '
Size: '.$sSize. '
S/L: '.$iSeeder.'/'.$iLeecher.''. '
Movie search'; //die(print_r($asArticle, true)); $oFeed->addItem($asArticle); } } return $oFeed->getFeed(); } echo parseTop10(); ?>