src/snapchat.php
public function findFriends($numbers, $country = 'US') {
		$batches = array_chunk(array_flip($numbers), 30, TRUE);

		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$results = array();
		foreach ($batches as $batch) {
			$timestamp = parent::timestamp();
			$result = parent::post(
				'/find_friends',
				array(
					'countryCode' => $country,
					'numbers' => json_encode($batch),
					'timestamp' => $timestamp,
					'username' => $this->username,
				),
				array(
					$this->auth_token,
					$timestamp,
				)
			);

			if (isset($result->results)) {
				$results = $results + $result->results;
			}
		}

		return $results;
	}
public function findFriends($numbers, $country = 'US') {
		$batches = array_chunk(array_flip($numbers), 30, TRUE);

		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$results = array();
		foreach ($batches as $batch) {
			$timestamp = parent::timestamp();
			$result = parent::post(
				'/find_friends',
				array(
					'countryCode' => $country,
					'numbers' => json_encode($batch),
					'timestamp' => $timestamp,
					'username' => $this->username,
				),
				array(
					$this->auth_token,
					$timestamp,
				)
			);

			if (isset($result->results)) {
				$results = $results + $result->results;
			}
		}

		return $results;
	}
public function findFriends ( $ numbers , $ country = 'US' ) { $ batches = array_chunk ( array_flip ( $ numbers ) , 30 , TRUE ) ; // Make sure we're logged in and have a valid access token. if ( ! $ this -> auth_token || ! $ this -> username ) { return FALSE ; } $ results = array ( ) ; foreach ( $ batches as $ batch ) { $ timestamp = parent :: timestamp ( ) ; $ result = parent :: post ( '/find_friends' , array ( 'countryCode' => $ country , 'numbers' => json_encode ( $ batch ) , 'timestamp' => $ timestamp , 'username' => $ this -> username , ) , array ( $ this -> auth_token , $ timestamp , ) ) ; if ( isset ( $ result -> results ) ) { $ results = $ results + $ result -> results ; } } return $ results ; }
Queries the friend-finding service.

@todo
If over 30 numbers are passed in, spread the query across multiple
requests. The API won't return more than 30 results at once.

@param array $numbers
An array of phone numbers.
@param string $country
The country code. Defaults to US.

@return mixed
An array of user objects or FALSE on failure.
Queries the friend - finding service .