Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
// Konfiguraciq
$link = "http://store1.data.bg/mopers/";
// Da nqma maksimalno vreme za izpalnenie
set_time_limit(0);
// Predstavqme se za Download Master, tai kato toi ima vazmojnost za barzo otvarqne na mnogo papki. Mojete da si go smenite na vseki edin ili da si napi6ete va6
ini_set('user_agent', 'Download Master');
$ind['d'] = 0;
$ind['f'] = 0;
$ind['e'] = 0;
$ind = get_links($link);
echo "<br><br>Directories indexed: ".$ind['d'];
echo "<br>Files indexed: ".$ind['f'];
echo "<br>Errors: ".$ind['e'];
////////////////////////////////////////////////
function get_links($url)
{
global $list, $ind;
// Proverqva dali e uspqlo da iztegli source koda
if ( !($source = @file_get_contents($url)) )
{
$ind['e'] = $ind['e'] + 1;
}
// Vzima vsi4ki linkove
$preg = "/a[\s]+[^>]*?href[\s]?=[\s\"\']+(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/";
preg_match_all(trim($preg), $source, $out, PREG_PATTERN_ORDER);
$links = $out[1];
// Za vseki link
foreach ($links as $href)
{
// ako e kam direktoriq
if ( eregi("/$", $href) )
{
$ind['d'] = $ind['d'] + 1;
echo $href."<br>";
get_links($url.$href);
}
// ako e kam fail
else
{
$ind['f'] = $ind['f'] + 1;
echo $href."<br>";
}
}
// Vra6ta informaciqta
return $ind;
}
?>
<?php
//***********************************************************************
//Author : Rahman Haqparast
//Contact : rahmanofsky@yahoo.co.uk
//License : Free for Non-commercial use
//Date : April 2003
//Edited : April 2005
//***********************************************************************
class fetchlinks
{
// Class Properties
// Private Varibales
var $_isolated_links;
var $_txt;
// Public Varibales
var $href;
var $caption;
var $url;
// Constructor
// The constructor gets the url you want to retrieve its links
function fetchlinks($_url)
{
$this->_txt=file_get_contents($_url);
$this->_txt=str_replace("<A",'<a',$this->_txt);
$this->_txt=str_replace("</A>",'</a>',$this->_txt);
$this->url=$_url;
}
// isolating <a>...</a>
// The _isolate() function isolates every <a>....</a> from the main text
// scope : Local
function _isolate()
{
$j = 0;
for ($i=0;$i<=strlen($this->_txt);$i++)
{
if (substr($this->_txt,$i,1+1)=="<a")
{
$j++;
$st=$i;
$k=$i;
while (substr($this->_txt,$k,3)!="/a>")
{
$k++;
}
$en=$k+2+1;
$this->_isolated_links[$j]=substr($this->_txt,$st,$en-$st);
}
}
}
// get_links() function extracts link data from the isolated links
// It first calls the _isolate() function and works on the isolated data
// scope : Global
function get_links()
{
$this->_isolate();
$k=0;
$n=0;
for ($i=1;$i<=count($this->_isolated_links);$i++)
{
for ($j=1;$j<=strlen($this->_isolated_links[$i]);$j++)
{
// in this part we'll find what is written in href part of <a> link
if (substr($this->_isolated_links[$i],$j,5)=='href=')
{
$n++;
$st=$j+5;
$m=$j+5;
while (substr($this->_isolated_links[$i],$m,1)!='>')
{
$m++;
}
$en=$m;
$temp=substr($this->_isolated_links[$i],$st,$en-$st);
if (strpos($temp,' ')>0) $temp=substr($temp,0,strpos($temp,' '));
$temp=str_replace('"','',$temp);
$temp=str_replace("'","",$temp);
if (substr($temp,0,1)=="/") $temp="$this->url".$temp;
if (substr($temp,0,7)!="http://") $temp="$this->url/".$temp;
if (!isset($p)) $p=0;
$this->href[0]="";
if (substr($temp,0,7)=="http://" && $temp!=$this->href[$p])
{
$p++;
$this->href[$p]=$temp;
}
//********************************************************************************
// in this part we'll find link captions or in other words anything between link tag <a ....>---</a>
while (substr($this->_isolated_links[$i],$m,1)!='>')
{
$m++;
}
$st=$m+1;
while (substr($this->_isolated_links[$i],$m,4)!='</a>')
{
$m++;
}
$en=$m;
if (substr($temp,0,7)=="http://")
{
$this->caption[$p]=substr($this->_isolated_links[$i],$st,$en-$st);
}
}
}
}
}
// This function will show the target of the links or in other words the href part of the <a> tag
// if $mode is set to "0" the links will be shown without indicating numbers
// if $mode is set to anything else the links will be shown with indicating numbers and "-->" sign
function show_href($mode)
{
$this->get_links();
for ($i=1;$i<count($this->href);$i++)
{
if ($mode==0) echo $this->href[$i]."\n<br>\n"; else echo $this->href[$i]."\n<br>\n";
}
}
// This function will show the caption of the links.
// if $mode is set to "0" the links will be shown without indicating numbers
// if $mode is set to anything else the links will be shown with indicating numbers and "-->" sign
function show_caption($mode)
{
$this->get_links();
for ($i=1;$i<=count($this->caption);$i++)
{
if ($mode==0) echo $this->caption[$i]."\n<br>\n"; else echo $i."-->".$this->caption[$i]."\n<br>\n";
}
}
}
?>
<?php
set_time_limit(300);
include "fetch.class.php";
$spider=new fetchlinks("http://dir.bg");
echo "Link Targets:<br>";
$spider->show_href(1);
?>
Дава ми грешка: Parse error: syntax error, unexpected '[' in C:\Program Files\xampp\htdocs\bot4e\fetch.class.php on line 117,демек на този код който заместих.jooorooo каза:намери
Код:if ($mode==0) echo $this->href[$i]."\n<br>\n"; else echo $this->href[$i]."\n<br>\n";
замести го с
Код:if ($mode==0) echo $this->urldecode(href[$i])."\n<br>\n"; else echo $this->urldecode(href[$i])."\n<br>\n";
<?php
//***********************************************************************
//Author : Rahman Haqparast
//Contact : rahmanofsky@yahoo.co.uk
//License : Free for Non-commercial use
//Date : April 2003
//Edited : April 2005
//***********************************************************************
class fetchlinks
{
// Class Properties
// Private Varibales
var $_isolated_links;
var $_txt;
// Public Varibales
var $href;
var $caption;
var $url;
// Constructor
// The constructor gets the url you want to retrieve its links
function fetchlinks($_url)
{
$this->_txt=file_get_contents($_url);
$this->_txt=str_replace("<A",'<a',$this->_txt);
$this->_txt=str_replace("</A>",'</a>',$this->_txt);
$this->url=$_url;
}
// isolating <a>...</a>
// The _isolate() function isolates every <a>....</a> from the main text
// scope : Local
function _isolate()
{
$j = 0;
for ($i=0;$i<=strlen($this->_txt);$i++)
{
if (substr($this->_txt,$i,1+1)=="<a")
{
$j++;
$st=$i;
$k=$i;
while (substr($this->_txt,$k,3)!="/a>")
{
$k++;
}
$en=$k+2+1;
$this->_isolated_links[$j]=substr($this->_txt,$st,$en-$st);
}
}
}
// get_links() function extracts link data from the isolated links
// It first calls the _isolate() function and works on the isolated data
// scope : Global
function get_links()
{
$this->_isolate();
$k=0;
$n=0;
for ($i=1;$i<=count($this->_isolated_links);$i++)
{
for ($j=1;$j<=strlen($this->_isolated_links[$i]);$j++)
{
// in this part we'll find what is written in href part of <a> link
if (substr($this->_isolated_links[$i],$j,5)=='href=')
{
$n++;
$st=$j+5;
$m=$j+5;
while (substr($this->_isolated_links[$i],$m,1)!='>')
{
$m++;
}
$en=$m;
$temp=substr($this->_isolated_links[$i],$st,$en-$st);
if (strpos($temp,' ')>0) $temp=substr($temp,0,strpos($temp,' '));
$temp=str_replace('"','',$temp);
$temp=str_replace("'","",$temp);
if (substr($temp,0,1)=="/") $temp="$this->url".$temp;
if (substr($temp,0,7)!="http://") $temp="$this->url/".$temp;
if (!isset($p)) $p=0;
$this->href[0]="";
if (substr($temp,0,7)=="http://" && $temp!=$this->href[$p])
{
$p++;
$this->href[$p]=$temp;
}
//********************************************************************************
// in this part we'll find link captions or in other words anything between link tag <a ....>---</a>
while (substr($this->_isolated_links[$i],$m,1)!='>')
{
$m++;
}
$st=$m+1;
while (substr($this->_isolated_links[$i],$m,4)!='</a>')
{
$m++;
}
$en=$m;
if (substr($temp,0,7)=="http://")
{
$this->caption[$p]=substr($this->_isolated_links[$i],$st,$en-$st);
}
}
}
}
}
// This function will show the target of the links or in other words the href part of the <a> tag
// if $mode is set to "0" the links will be shown without indicating numbers
// if $mode is set to anything else the links will be shown with indicating numbers and "-->" sign
function show_href($mode)
{
$this->get_links();
for ($i=1;$i<count($this->href);$i++)
{
if ($mode==0) echo urldecode($this->href[$i])."\n<br>\n"; else echo urldecode($this->href[$i])."\n<br>\n";
}
}
// This function will show the caption of the links.
// if $mode is set to "0" the links will be shown without indicating numbers
// if $mode is set to anything else the links will be shown with indicating numbers and "-->" sign
function show_caption($mode)
{
$this->get_links();
for ($i=1;$i<=count($this->caption);$i++)
{
if ($mode==0) echo $this->caption[$i]."\n<br>\n"; else echo $i."-->".$this->caption[$i]."\n<br>\n";
}
}
}
?>
<?php
// Konfiguraciq
$link = "http://store1.data.bg/mopers/";
// Da nqma maksimalno vreme za izpalnenie
set_time_limit(0);
// Predstavqme se za Download Master, tai kato toi ima vazmojnost za barzo otvarqne na mnogo papki. Mojete da si go smenite na vseki edin browser ili da si napi6ete va6
ini_set('user_agent', 'Download Master');
$ind['d'] = 0;
$ind['f'] = 0;
$ind['e'] = 0;
$ind = get_links($link);
echo "<br><br>Directories indexed: ".$ind['d'];
echo "<br>Files indexed: ".$ind['f'];
echo "<br>Errors: ".$ind['e'];
////////////////////////////////////////////////
function get_links($url)
{
global $list, $ind;
if ( !($source = @file_get_contents($url)) )
return false;
// Vzima vsi4ki linkove
$preg = "/a[\s]+[^>]*?href[\s]?=[\s\"\']+(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/";
preg_match_all(trim($preg), $source, $out, PREG_PATTERN_ORDER);
$links = $out[2];
// Za vseki link
foreach ($links as $href)
{
// Ako vodi kam gorna direktoriq da ne go otvarq ili ako e prazen
if (( eregi("\<img", $href) ) or ( eregi("Име", $href) ) or ( eregi("Модифициран", $href) ) or ( eregi("Големина", $href) ) or (empty($href)) or ( eregi("Предна директория", $href) ) or ( eregi("FREE.Data.BG", $href) ) or ( eregi("webmaster@data.bg", $href) ))
continue;
$href = str_replace(' ', "%20", $href);
// ako e kam direktoriq
if ( (eregi("/$", $href)) )
{
if (get_links($url.$href))
{
echo $url.$href."<br>";
$ind['d'] = $ind['d'] + 1;
@ob_flush();
flush();
}
}
// ako e kam fail
else
{
$ind['f'] = $ind['f'] + 1;
echo $url.$href."<br>";
@ob_flush();
flush();
}
}
// Vra6ta informaciqta
return $ind;
}
?>


<?php
$url = "http://store1.data.bg/mopers/";
$redove = file($url);
$count = count($redove);
echo "URL: ".$url."<br /><br />";
for($i=1; $i<=$count ;$i++){
if(ereg("onClick=location.href=\"".$url."(.*).mp3\" style='cursor:hand'", $redove[$i], $mp3)){
if($mp3[1] != "../"){
echo str_replace("%20", " ", $mp3[1])." - ".$url.$mp3[1].".mp3<br />\n";
}
} elseif(ereg("onClick=location.href=\"".$url."(.*).Mp3\" style='cursor:hand'", $redove[$i], $mp3)){
if($mp3[1] != "../"){
$mp3[1] = str_replace("%20", " ", $mp3[1]);
echo $mp3[1]."<br />\n";
}
} elseif(ereg("onClick=location.href=\"".$url."(.*).MP3\" style='cursor:hand'", $redove[$i], $mp3)){
if($mp3[1] != "../"){
$mp3[1] = str_replace("%20", " ", $mp3[1]);
echo $mp3[1]."<br />\n";
}
}
}
?>