Dave Bullock / eecue

photographer, programmer, husband,
photojournalist, caver, blogger, search and rescuer,
angeleno, foodie, hacker, nerd, geek, human

added news scraping from google to junglescene

it was pretty easy to do the code is contained in the article:

$news_out =" " ;

$src = 'http://news.google.com/';
$found = 0;
$skip = 1;
$i = 1;
$fp = fopen ($src, " r" );
while ((!feof ($fp)) && (!$found))
{

$line = fgets($fp, 4096);
$line = str_replace(" src=/" ," src=http://news.google.com/" ," $line" );
$line = str_replace(" $line = str_replace(" /a> " ," " ," $line" );
$line = str_replace(" href=/" ," href=http://news.google.com/" ," $line" );
$line = str_replace(" style=cursor:hand;" ," " ," $line" );
$line = str_replace("  " ," " ," $line" );
$line = str_replace("  " ," " ," $line" );
$line = strip_tags (" $line" ," " );
$i = ++$i;
if ($i > 110)
{
$news_out .= $line;
}
}
fclose($fp);