function get_pageSource ( $url ) { $handle = fopen($url ,'r'); $scraped = ''; if ($handle) { while (!feof($handle)) { $buffer = fgets($handle, 4096); $scraped .= $buffer; } fclose($handle); } return $scraped; } echo get_pageSource ('http://digg.com/programming'); PHP: it timeouts only on digg.com, they must have a restriction or something...maybe a better function to trick it?
Try using curl which gives you control over the user agent and other identifying features. Or try taking the while off and make it for($i = 0; $i < $max; $i++) and make $max a small number like 10 and see if it's the connection to digg that is the problem - or what it returns.
Oh well...thanks sarah. I was hoping for something better but I'll have to enable curl on my localhost now and use it. Thanks