Re: make use of search results from public search engines

From: Date: Mon, 14 Aug 2000 21:55:52 +0000
Subject: Re: make use of search results from public search engines
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-11693@lists.php.net to get a copy of this message
It's terribly wonderful. How can it be so easy? If I'm the owner of the search engine, how can I prevent my information from being stolen in this way? It seems that the answer is no way... terrible. Anyway, thanks Lars (about the cool script) and Urb (about the copyright stuff) for your enlightenment. Regards, Koo Lars Torben Wilson wrote: > You're going to too much trouble: you can get the information easier > using something like this (note that this simple example dosen't even > try to cope with the next/last page thing, although it should be > fairly easy to do this). But I'm not sure that Google would be too > happy about you using this, since they sell this service > separately. This is only meant to demonstrate one way of doing this > sort of thing. :) > > <?php > error_reporting(E_ALL); > > $fp = > fopen("http://www.google.com/search?q=zend+optimizer+site:www.php.net", > 'r'); > $msg = ''; > $count = 0; > while (!feof($fp)) { > $tmp = fgets($fp, 4096); > if (preg_match('/^<p><A HREF=/', $tmp)) { > $msg .= $tmp; > $count++; > } > } > fclose($fp); > echo "<h2>Search found $count hits:</h2>$msg\n"; > ?> > > Cheers, > > Torben > > -- > +----------------------------------------------------------------+ > |Torben Wilson <torben@php.net> Netmill iTech| > |http://www.coastnet.com/~torben LéP9›:ýZ…O"�(A > http://www.netmill.fi| > |Ph: 1 250 383-9735 torben@netmill.fi| > +----------------------------------------------------------------+

« previous php.general (#11693) next »