Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Retrieving Google Search Results

    i have this code, it succesfully retrieves the search results from google. the only problem is it only retrieves a limited number of results. unlike when you are searching the same query in the google page. the results are more than the results given by the code

    are there any other way to retrieve google results?

    *mi first post pls be kind to me :innocent:


    PHP Code:
        $search 'query';
        
    $obj json_decodefile_get_contents'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=' urlencode$search ) ) );
                foreach(
    $obj ->responseData->results as $i){
                    echo 
    $i->unescapedUrl.'<br/>';
                }
        } 

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    From what is posted above... no $obj contains all the data retrieved from the api and the foreach goes through all the results in obj.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Quote Originally Posted by Phil Jackson View Post
    From what is posted above... no $obj contains all the data retrieved from the api and the foreach goes through all the results in obj.
    actually sir try pasting
    Code:
    http://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=search
    to your address bar. it will give you a response which becomes the value for $obj

    to view it properly
    Code:
    <pre>
    <?php echo $obj; ?>
    </pre>
    Last edited by kapitanluffy; 08-16-2010 at 12:59 PM. Reason: wrong code


  •  

    Tags for this Thread

    Posting Permissions

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