Re: make use of search results from public search engines
| From: | Thomas Edison Jr. | Date: | Wed, 16 Aug 2000 06:42:51 +0000 |
| Subject: | Re: make use of search results from public search engines | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11933@lists.php.net to get a copy of this message | ||
Lars,
We've developed a search engine with our own database
which will have the links & data to be searched.
However, since it's a brand new search engine -
there's no entries in it as yet, and will take quite
some considerable time before the search engine is
"Search-Ready".
Using the code that you gave, one can get data
searched through the google database and get the
results on thier site. However, what we want is that
until our search engine has enough data to be
searched, we should be able to use the google database
for searches within our search engine. is it possible?
The submissions will go into our database. And the
searches will be two-way = through our database as
well as through the google database and the results
displayed on our pages. can it be done?
Thanx,
T. Edison jr.
--- Lars Torben Wilson <torben@pinc.com> wrote:
>
> Koo writes:
> > By specifying the following URL, you can use
> Google to search some
> > specific websites, "www.php.net" in this case, by
> providing certain
> > keywords, "zend optimizer" in this case.
> >
> >
>
http://www.google.com/search?q=zend+optimizer+site:www.php.net
> >
> > Now, I'd like to buildup a search interface (a
> text box) for user
> > to do the above search and have the results
> displayed on MY WEBSITE.
> >
> > How do I do that?
> >
> > I tried the following script, but it doesn't work.
> :-(
> >
>
> [snip]
>
> >
> > Thanks.
> > Koo
>
>
> 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
> http://www.netmill.fi|
> |Ph: 1 250 383-9735
> torben@netmill.fi|
>
+----------------------------------------------------------------+
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : abraxastech@yahoo.com
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/