src/snapchat.php
function getFriendStories($force = FALSE) {
		if (!$force) {
			$result = $this->cache->get('stories');
			if ($result) {
				return $result;
			}
		}

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

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/all_updates',
			array(
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		if (!empty($result->stories_response)) {
			$this->cache->set('stories', $result->stories_response);
		}
		else {
			return FALSE;
		}

		$stories = array();
		foreach ($result->stories_response->friend_stories as $group) {
			foreach ($group->stories as $story) {
				$stories[] = $story->story;
			}
		}

		return $stories;
	}
function getFriendStories($force = FALSE) {
		if (!$force) {
			$result = $this->cache->get('stories');
			if ($result) {
				return $result;
			}
		}

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

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/all_updates',
			array(
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		if (!empty($result->stories_response)) {
			$this->cache->set('stories', $result->stories_response);
		}
		else {
			return FALSE;
		}

		$stories = array();
		foreach ($result->stories_response->friend_stories as $group) {
			foreach ($group->stories as $story) {
				$stories[] = $story->story;
			}
		}

		return $stories;
	}
function getFriendStories ( $ force = FALSE ) { if ( ! $ force ) { $ result = $ this -> cache -> get ( 'stories' ) ; if ( $ result ) { return $ result ; } } // Make sure we're logged in and have a valid access token. if ( ! $ this -> auth_token || ! $ this -> username ) { return FALSE ; } $ timestamp = parent :: timestamp ( ) ; $ result = parent :: post ( '/all_updates' , array ( 'timestamp' => $ timestamp , 'username' => $ this -> username , ) , array ( $ this -> auth_token , $ timestamp , ) ) ; if ( ! empty ( $ result -> stories_response ) ) { $ this -> cache -> set ( 'stories' , $ result -> stories_response ) ; } else { return FALSE ; } $ stories = array ( ) ; foreach ( $ result -> stories_response -> friend_stories as $ group ) { foreach ( $ group -> stories as $ story ) { $ stories [ ] = $ story -> story ; } } return $ stories ; }
Gets friends' stories.

@param bool $force
Forces an update even if there's fresh data in the cache. Defaults
to FALSE.

@return mixed
An array of stories or FALSE on failure.
Gets friends stories .