How to create a search engine which displays search results from google, amazon, ebay

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roccos
    New Member
    • Feb 2009
    • 12

    How to create a search engine which displays search results from google, amazon, ebay

    Hi guys,

    How to create a search engine (script) which displays search results from Google, Amazon, eBay, etc Including our own results.

    I have experience in developing database driven search engines,

    Please help..........
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by roccos
    Hi guys,

    How to create a search engine (script) which displays search results from Google, Amazon, eBay, etc Including our own results.

    I have experience in developing database driven search engines,

    Please help..........
    You will have to parse the webpages results, using regular expressions. Here is an example that parses google for it's results:
    Code:
    <?php
    
    // Url to search page.
    $url 		= "http://www.google.co.uk/search?hl=en&q=php&btnG=Google+Search&meta=";
    // Grab the contents from url.
    $contents 	= file_get_contents( $url );
    // Expression to retreive H3 tags.
    $exp		= "/<h3 class=r>(.*?)<\/h3\>/";
    
    // get results (note: preg_match_all)
    preg_match_all( $exp, $contents, $results );
    echo '<pre>';
    // Print thr results - note index of 1 not 0.
    print_r( $results[1] );
    echo '</pre>';
    	 
    ?>
    And here is a tutorial for parsing webpages.

    Mark.

    ps: Please use the bold tag ([b]) sparingly.

    Comment

    Working...