Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show Google Search results embedded in my website?

Tags:

html

search

I am using this code in my website to show Google search results for my website :

<!-- Search block -->       
<div class="searchBox">
    <form method="get" action="http://www.google.com/search"> 
        <input type="text" name="query" class="searchField" />
        <input type="hidden" name="sitesearch" value="my_website.com">
        <input type="submit" value="" class="searchSubmit">
    </form>
</div>  

I like that simple code and i do not prefer to use Google Custom Search, but is there a way to show the output of this search embedded in a page i specify ?

like image 488
Brad Avatar asked Apr 05 '12 12:04

Brad


2 Answers

Bing has a much better terms of use and an excellend API when it comes to site search integration.

It lets you take the XML that is returned and pretty much do whatever you want with it as long as you reference that your search is being powered by Bing somewhere in the result list.

Checkout my post here http://www.foliotek.com/devblog/integrating-bing-search-results-within-a-web-app-using-net/.

As far as Google results your only option is to use there built in frameing. The fully custom search cost were super high when I looked to do it behind SSL. For more information on Google Custom Search go here http://www.google.com/cse/.

Real World Bing Example A: http://www.mshsaa.org/Search/?q=basketball

like image 183
bigamil Avatar answered Sep 22 '22 20:09

bigamil


You could read the content from the page with file_get_contents and than read out the parts you need and display them on your page.

http://php.net/manual/en/function.file-get-contents.php

like image 37
Maarten Kuilman Avatar answered Sep 20 '22 20:09

Maarten Kuilman