+ Post New Thread
Results 1 to 8 of 8
Windows Thread, Searching under different sites in Technical; Hi guys Just wondering if anyone can help me on this! Basically i was wondering whether anyone knew of a ...
  1. #1

    Join Date
    Mar 2007
    Location
    Leicestershire
    Posts
    274
    Thank Post
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    16

    Searching under different sites

    Hi guys

    Just wondering if anyone can help me on this!

    Basically i was wondering whether anyone knew of a system that could basically search other sites from a user input on a different site? Something similar to price comparison sites that take an input from a user on a site, submits it to different sites or a single site, searches within that database and then feeds the information back to the user?

    Hope this makes sense, any thought on this would be appreciated!

  2. #2

    Join Date
    Apr 2008
    Location
    Keighley, West Yorks
    Posts
    326
    Thank Post
    52
    Thanked 49 Times in 43 Posts
    Rep Power
    21
    Hi Marvin,

    Would something like DogPile meet your needs?

    (Yes, I know it sounds inappropriate but believe me it's a legit site!)

    DogPile takes your search term and re-submits it to others such as google and yahoo etc, then displays the results from each?

    Peter

  3. #3

    Join Date
    Mar 2007
    Location
    Leicestershire
    Posts
    274
    Thank Post
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    16
    That would only access search engines...
    What i want is my site to collect data from user, that data is stored on a database on my side, send it to a specific site that will check that search criteria on their side and then tell me the answer.

    I know this can be done by the user going directly to that site but what i want is do some calculation from the result of that site and then tell the user about it!

    Hope that makes sense.

  4. #4

    Join Date
    Apr 2008
    Location
    Keighley, West Yorks
    Posts
    326
    Thank Post
    52
    Thanked 49 Times in 43 Posts
    Rep Power
    21
    Quote Originally Posted by marvin View Post
    Hope that makes sense.
    Kind of...!

    I think you'd need something like PHP's cURL library (or any other language with similar features) which will allow you to take an input ($query) then PHP will pop along to the target site (google for example) and pass it the $query (via the address bar) then be given back the answer (result page) that you would normally see, in a big long string being the html content of the results page.

    You could then parse this and obtain the bits you want out of it, perform calculations, then output whatever to the user?

    Peter

  5. #5

    Join Date
    Mar 2007
    Location
    Leicestershire
    Posts
    274
    Thank Post
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    16
    so for example let's assume

    If i design a form which collects some data from the user such as Name, surname, travelling from -> to, time travelling and the date.

    Now i want that information fed to let's say Book Flights, Hotels, Holidays, Car Rental with British Airways - BA.com so that it will check the flight available during the travel request dates and timings and then feed that information back to me on my site.

    Is this possible? And how could i do this?

  6. #6

    Join Date
    Apr 2008
    Location
    Keighley, West Yorks
    Posts
    326
    Thank Post
    52
    Thanked 49 Times in 43 Posts
    Rep Power
    21
    Quote Originally Posted by marvin View Post
    Is this possible?
    Unlikely.

    The site you want to search would ideally need to be one which uses the address bar to pass parameters. So for example with Google, which would work, you can go to:

    Code:
    http://www.google.co.uk/search?q=my_search_term
    This would mean you could take the input yourself ('my_search_term') then pass it to Google.

    However BA doesn't appear to have anything of the form:

    Code:
    www.ba.com/book?type=flight&from=Gatwick&to=Luton&depart=251209&return=030110&tickets=1
    which you would need to be able to search results from another site.

    If you can find a BA alternative which has something of the form shown for Google/BA, then you would be able to do it.

    If you do find one, you'd have a normal html form on your page, with it's 'action' set to processform.php which would have something like the following in:
    _

    <?php
    //Set variables to answers from form
    $searchterm = $_POST["searchterm"];

    // create curl resource
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "www.google.co.uk/search?q=" $searchterm);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $output = curl_exec($ch);
    curl_close($ch);

    ?>

    Don't worry about what all that does for the moment, but it will give you $output which will contain the html code of the results from google (or the BA alternative in your case) as follows:

    Code:
    <html><head>
    <title>Google Results</title>
    </head>
    
    <body>
    <a href="result1.com">Result1</a>
    <a href="result2.com">Result2</a>
    <a href="result3.com">Result3</a>
    </body>
    </html>
    Unfortunately the html code will be far more complicated than that, but if you can parse that lot into a list of:

    Result1 = BBC - Homepage
    Result2 = Yahoo! UK & Ireland

    (or, in your case

    Flight1 = London to Gatwick, 25th December, 10.04am
    Flight2 = London to Gatwick via Luton, 25th December, 11.26am
    etc

    then you can do what you like entering it in the Database and displaying results.
    _

    I don't know how much website coding you know, but hopefully if you know enough to be undertaking this project, you will be able to take what I've given and turn it into full code...?

    Peter
    Last edited by howartp; 25th November 2009 at 02:56 PM.

  7. #7

    Join Date
    Mar 2007
    Location
    Leicestershire
    Posts
    274
    Thank Post
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    16
    I thought this was kind of not possible!
    Basically the only way i could do this is if i had access to their live DB which i will never have access to?

  8. #8

    Join Date
    Apr 2008
    Location
    Keighley, West Yorks
    Posts
    326
    Thank Post
    52
    Thanked 49 Times in 43 Posts
    Rep Power
    21
    Quote Originally Posted by marvin View Post
    I thought this was kind of not possible!
    Basically the only way i could do this is if i had access to their live DB which i will never have access to?
    For someone like BA, yes that would likely be the only way.

    Google and other search engines can be done far easier, as above.

    Peter

SHARE:
+ Post New Thread

Similar Threads

  1. Google Searching
    By wesleyw in forum Internet Related/Filtering/Firewall
    Replies: 4
    Last Post: 7th July 2009, 03:46 PM
  2. Searching 'within' cookies?
    By theeldergeek in forum Windows
    Replies: 10
    Last Post: 21st October 2008, 02:23 PM
  3. Searching Problems
    By Joanne in forum General Chat
    Replies: 0
    Last Post: 25th January 2008, 03:55 PM
  4. Predictive searching......
    By Lee_K_81 in forum Network and Classroom Management
    Replies: 8
    Last Post: 28th March 2007, 12:53 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •