How can I get the recent tweets than last time checked?
<p>I am using PHP and tweeter RSS to parse the tweets and trying to store the tweets in the database. </p>

<p>Is there any way, I can get/parse only the recent tweets than the last time parsed OR checked?  because every now and then there may be tweets updates on tweeter RSS. </p>

<pre><code>function fetch_rss_tweets($username, $maxtweets) {
 //Using simplexml to load URL
 $tweets = simplexml_load_file("http://twitter.com/statuses/user_timeline/" . $username . ".rss");


 $tweet_array = array();  //Initialize empty array to store tweets
 foreach ( $tweets-&gt;channel-&gt;item as $tweet ) { 

    /*  print '&lt;pre&gt;';
        print_r ($tweet);
        print '&lt;/pre&gt;';*/

      //Loop to limitate nr of tweets.
      if ($maxtweets == 0) {
           break;
      } else {
           $twit = $tweet-&gt;description;  //Fetch the tweet itself

           //Remove the preceding 'username: '
           $twit = substr(strstr($twit, ': '), 2, strlen($twit));

           // Convert URLs into hyperlinks
         //  $twit = preg_replace("/(http:\/\/)(.*?)\/([\w\.\/\&amp;\=\?\-\,\:\;\#\_\~\%\+]*)/", "&lt;a href=\"\\0\"&gt;\\0&lt;/a&gt;", $twit);

           // Convert usernames (@) into links 
           $twit = preg_replace("(@([a-zA-Z0-9\_]+))", "&lt;a href=\"http://www.twitter.com/\\1\"&gt;\\0&lt;/a&gt;", $twit);

           // Convert hash tags (#) to links 
           $twit = preg_replace('/(^|\s)#(\w+)/', '\1&lt;a href="http://search.twitter.com/search?q=%23\2"&gt;#\2&lt;/a&gt;', $twit);

           //Specifically for non-English tweets, converts UTF-8 into ISO-8859-1
           $twit = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $twit);


           //Store tweet and time into the array
           $tweet_item = array(
                 'desc' =&gt; $twit,                                        
           );
           array_push($tweet_array, $tweet_item);

           $maxtweets--;
      }
 }
 //Return array
 return $tweet_array;
</code></pre>

<p>}</p>
