SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Quick RegExp
-
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!
-
Jun 30, 2007, 01:10 #2
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
http://www.google.com/accounts/TOS?loc=US
Originally Posted by Google Terms of Service
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jun 30, 2007, 01:14 #3
Yeah, I know that, but they won't even notice me.
I have 10 users a day
-
Jun 30, 2007, 02:36 #4
- Join Date
- Mar 2005
- Location
- Ukraine
- Posts
- 1,403
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 30, 2007, 04:51 #5
OK,
can anybody help me extract a div from a page?
It looks like this:
<div id="idname"> ... </div>
Thanks!
Bookmarks