<?php
for($i=1;$i<1386;$i++) { #max = 1385
@$
handle = fopen("http://www.youtube.com/profile_subscribers?user=renetto&page=".$i, "rb");
if($
handle == false){ echo "could not open"; exit(); }
$site = stream_get_contents($
handle);
$from = "sites/site".$i.".htm";
$fp = fopen($from, "a+");
fwrite($fp, $site);
fclose($fp);
}
?>
...
<?php
$subscriberlist = array();
for($i=1301;$i<1385;$i++)
{ #max = 1385
$from = "sites/site".$i.".htm";
@$
handle = fopen($from, "r");
if($
handle == false){ echo "could not open"; exit(); }
$story = stream_get_contents($
handle);
preg_match_all('/<a href="\/user\/(.+)">\w+<\/a>/',$story,$users);
$subscriberlist = array_merge($subscriberlist, $users[1]);
}
for($i=0;$i<sizeof($subscriberlist);$i++)
{
$fp = fopen("user.txt", "a+");
fwrite($fp, $subscriberlist[$i]."\n");
fclose($fp);
}
?>