title: Getting previous statuses from $facebook->api('/me/feed')
body: <p>I've been trying to access previous statuses posted by current user (the one that logs in). It seems to be unreliable and the number of statuses returned seems to vary. </p>
  
  <p>I understand that you can use ?limit=, ?since= and ?until=, however when I use ?limit=1000 thats say large enough to get some of the earlier posts made by the user it becomes unpredictable.</p>
  
  <p><strong>What I want to be able to do is access the first few statuses I've posted since I joined Facebook. What would the best way to do this?</strong> (Using '?limit=1000' seems a bit excessive!)</p>
  
  <p>This sets permissions etc and then grabs the feed:
      
  
  <pre><code>require 'php-sdk/src/facebook.php';
  
  $facebook = new Facebook(array(
    'appId'  =&gt; 'xxxxxxxx',
    'secret' =&gt; 'xxxxxxxxxxxxxxxxxxxx', 
    'cookie' =&gt; true
  ));
  
  $user = $facebook-&gt;getUser();
  
  // Permissions required
  $par = array();
  $par['scope'] = "status_update user_about_me user_status";
  
  $feed = null;
  $profile = null;
  $loginUrl = null;
  
  if ($user) {
      $logoutUrl = $facebook-&gt;getLogoutUrl();
      try {
          // Proceed knowing you have a user who is logged in and authenticated
  
          // Get Feed
          $feed = $facebook-&gt;api('/me/feed');
          // Get User Profile
          $profile = $facebook-&gt;api('/me');
      } catch (FacebookApiException $e) {
          error_log($e);
          $user = null;
      }   
  } 
  else {
      $loginUrl = $facebook-&gt;getLoginUrl($par);
  }
  
  ?&gt;
  </code></pre>
  
  <p>This is what I'm using to display the statuses updates from the feed:</p>
  
  <pre><code>foreach ($feed['data'] as $entry)
  {
      // If its a message posted by user
      $isStatusUpdate = array_key_exists('message', $entry) and $entry['from']['name'] == $profile['name'];
  
      if ($isStatusUpdate)
      {
          $likes = 0;
          $comment = 0;
  
          // Get num of likes 
          if (array_key_exists('likes', $entry))
              $likes = count($entry['likes']); 
  
          // Get num of comments
          if (array_key_exists('comments', $entry))
              $comments = count($entry['comments']);
  
          // Display message with num of likes and comments
          echo '&lt;div class="row"&gt;&lt;div class="span4 columns"&gt;&lt;h2&gt;Post '.$counter.'&lt;/h2&gt;';
          echo '&lt;p&gt;Likes '.$likes.'&lt;/br&gt;';
          echo 'Comments '.$comments.'&lt;/p&gt;&lt;/div&gt;';
          echo '&lt;div class="span12 columns"&gt;&lt;h3&gt;'.substr($entry['created_time'], 0, 10).'&lt;/h3&gt;';
          echo '&lt;pre class="prettyprint"&gt;'.$entry['message'].'&lt;/pre&gt;&lt;/div&gt;';
      }
  }
  </code></pre>