SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Quick RegExp
Threaded View
-
Jun 30, 2007, 00:56 #1
Quick RegExp
Hello
I've been trying for over a month now and I can't get it to work
I'm trying to make a little widget for my site that parses Google results
so that my visitors don't have to go away from the site
This is what I've done so far:
Code:// open the site $handle=fopen("full url for searching", 'r'); // place it in a string while (!feof($handle)) { $content .= fgets($handle, 4096); } // strip out the divs with data preg_match('/<div class=\"g\">.*<\/div>/', $content, $result); // output the results foreach($result as $div) { echo $div; }
description, but it doesn't work..
I've tried &output=xml - but Google banned that approach.
Can anybody give a hand?
What I would like to get as the result is:
TITLE
DESCRIPTION
URL
Thanks in advance!
Bookmarks