Google API filter trouble

Discussion in 'Google API' started by jdevalk, Sep 18, 2006.

  1. #1
    I'm querying Google websearch throught the API, and i can't seem to get the filtering to work, as i get 7 results from the same host for my query. I use PHP, with the latest NUSOAP, and the following params:

    $params = array(
    		'key' => $googleapikey, 
    		'q' => $query, 
    		'start' => 0, 
    		'maxResults' => 1,
    		'filter' => true, 
    		'restrict' => '',
    		'safeSearch' => false,
    		'lr' => '',
    		'ie' => '',
    		'oe' => ''
    	); 
    PHP:
    Anyone got a clue as to what i'm doing wrong / what is wrong?
     
    jdevalk, Sep 18, 2006 IP
  2. KC TAN

    KC TAN Well-Known Member

    Messages:
    4,792
    Likes Received:
    353
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Try putting quotes around the values:
    
    
          $params = array(
    
                  'key' => $googleapikey,
    
                  'q' => $query,
    
                  'start' => '0',
    
                  'maxResults' => '1',
    
                  'filter' => 'true',
    
                  'restrict' => '',
    
                  'safeSearch' => 'false',
    
                  'lr' => '',
    
                  'ie' => '',
    
                  'oe' => ''
    
              ); 
    
    PHP:
     
    KC TAN, Sep 19, 2006 IP
  3. jdevalk

    jdevalk Active Member

    Messages:
    417
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    68
    #3
    that won't work, gives an error :)
     
    jdevalk, Sep 19, 2006 IP
  4. justtupeu

    justtupeu Peon

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Similar problem here.. Would be grateful if somebody can help.
     
    justtupeu, Sep 21, 2006 IP
  5. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sounds like you are echoing the same value 7 times?
     
    mad4, Sep 21, 2006 IP
  6. jdevalk

    jdevalk Active Member

    Messages:
    417
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    68
    #6
    Nope, i get unfiltered results, 6 different results from the same host.
     
    jdevalk, Oct 16, 2006 IP