views:

42

answers:

2

Is der any method to read the Google search result and display it own style . I want to read the contents of Google search results after users search for query will display only the .PDF files for the search queries is it possible to do with PHP ?

+3  A: 

Yes, by using Google's public search API.

Bart Kiers
I think this is also a good place to start: http://code.google.com/intl/en/apis/customsearch/docs/api.html
pritaeas
A: 

Like Bart mentioned you can and should use the API so as be on the up and up with Google.

But that being said if you want to really have a hack you can just make a curl request from php to do the search against google and parse the results. Or you could even do it in perl and just run the perl script from php.

But again this is not the preferred solution. I am just trying to provide an answer for your question. And yes it can be done.

spinon
Note that Google might ban the IP addresses from hosts that do a lot of those "hack-searches". Also, last I checked, only clients that "look" like a browser can get search results back, so you'd have to pretend to be a browser in the request-header.
Bart Kiers
Totally agree Bart and I know from experience that they will catch on and limit you to so many per day. There are some ways around it that I found. (Had a client that had very similar needs so I did the work. They paid good.) But it's really not worth it. It's better to just have good practices from the beginning so as to limit headaches later.
spinon
ok but how can i display the result in PHP.. how can i retrieve the results. that is my major problem ?
I am going to assume you want to use the search API vs the method I described in my answer since this is the preferred method you should use. With that being the case you can check out their code playground which has working code samples: http://code.google.com/apis/ajax/playground/?exp=search#the_hello_world_of_blog_searchAlso you can look here: http://code.google.com/apis/ajaxsearch/documentation/For specific code examples of how to do this in PHP.
spinon
www.sphider.eu.. I used third party Tool.. sphider.. and working fine with PHP.