1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Facebook Api Search for people like"Andre"

Discussion in 'Facebook API' started by kissthechief, Jul 20, 2012.

  1. #1
    Hello

    Ive Created a new App on facebook to get all my IDs and token and implentend my code
    Im trying to find all people with “Andre” but i dont get any results back
    Is there a way to find People throught the API without the ID or the whole name?
    to make it easier for you to help me
    
    
    function callFb($url)
    {
        $ch = curl_init();
        curl_setopt_array($ch, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true
        ));
     
        $result = curl_exec($ch);
        curl_close($ch);
        return $result;
    }
     $url =  “https://graph.facebook.com/oauth/access_token?client_id=myClientId&redirect_uri=myurl.php&client_secret=thisstaysaSecret;
    $access_token = callFb($url);
    $access_token = substr($access_token, strpos($access_token, “=”)+1, strlen($access_token));
    $url = “https://graph.facebook.com/search?access_token=$access_token&q=Andre&type=user”;
    $ret_json = callFb($url);
    $users = json_decode($ret_json, true);
    echo”$users[id]“;
    ?>
     
    Any Ideas whats wrong?
    SEMrush
     
    Last edited: Jul 20, 2012
    kissthechief, Jul 20, 2012 IP
    SEMrush
  2. inout

    inout Greenhorn

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #2
    there is some issue sometimes with facebook, they only return result some time..i will give an example of one i did similar soon i need to find where it is.. its been a long time. tomorrow i will post
     
    inout, Aug 8, 2012 IP