? twitter_pull_page.patch
Index: twitter_pull.class.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/twitter_pull/twitter_pull.class.inc,v
retrieving revision 1.2.2.6
diff -u -p -r1.2.2.6 twitter_pull.class.inc
--- twitter_pull.class.inc	11 Jan 2011 04:12:54 -0000	1.2.2.6
+++ twitter_pull.class.inc	20 Feb 2011 02:27:14 -0000
@@ -18,10 +18,11 @@ class twitter_puller {
   * @param $num_items
   *     maximum number of tweets to pull from Twitter.
   */
-  function __construct($twitkey, $num_items) {
+  function __construct($twitkey, $num_items, $page) {
 
     $this->twitkey = $twitkey;
     $this->num_items = $num_items;
+    $this->page = $page;
 
     $this->check_arguments();
 
@@ -45,6 +46,7 @@ class twitter_puller {
     $prefix = drupal_substr($this->twitkey, 0, 1);
     $slash = strpos($this->twitkey, '/', 1);
     $num = intval($this->num_items);
+    $page = intval($this->page);
 
     // lists have the format @username/listname
     if ($prefix == '@' && $slash !== FALSE) {
@@ -55,14 +57,14 @@ class twitter_puller {
     // if the first character is @, then consider the key a username
     elseif ($prefix == "@") {
       $key = drupal_substr($this->twitkey, 1);
-      $url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name='. urlencode($key) .'&include_rts=true&count='. $num;
+      $url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name='. urlencode($key) .'&include_rts=true&count='. $num .'&page='. $page;
     }
     // otherwise, use the key as a search term
     else {
       if ($num > 100) {
         $num = 100;
       }
-      $url = 'http://search.twitter.com/search.json?q=' . urlencode($this->twitkey) . '&rpp=' . $num;
+      $url = 'http://search.twitter.com/search.json?q=' . urlencode($this->twitkey) . '&rpp=' . $num . '&page='. $page;
     }
 
     $ret = drupal_http_request($url);
Index: twitter_pull.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/twitter_pull/twitter_pull.module,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 twitter_pull.module
--- twitter_pull.module	11 Jan 2011 04:08:16 -0000	1.2.2.2
+++ twitter_pull.module	20 Feb 2011 02:27:14 -0000
@@ -70,13 +70,13 @@ function twitter_pull_theme() {
  * @param $themekey
  *     Theme key name to use for theming the output of Twitter API.
  */
-function twitter_pull_render($twitkey, $title = NULL, $num_items = NULL, $themekey = NULL) {
+function twitter_pull_render($twitkey, $title = NULL, $num_items = NULL, $themekey = NULL, $page = 1) {
   //-- Set defaults if empty arguments were passed
   $title = (empty($title) && $title != FALSE ) ? t('Related Tweets') : $title;
   $themekey = empty($themekey) ? 'twitter_pull_listing' : $themekey;
   $num_items = empty($num_items) ? twitter_pull_num_items() : $num_items;
 
-  $tweets = twitter_pull_retrieve($twitkey, $num_items);
+  $tweets = twitter_pull_retrieve($twitkey, $num_items, $page);
 
   $ret = theme($themekey, array('tweets' => $tweets, 'twitkey' => $twitkey, 'title' => $title));
 
@@ -98,13 +98,13 @@ function twitter_pull_render($twitkey, $
  * @param $num_items
  *     Number of tweets to retrieve from Twitter. Can't be more than 200.
  */
-function twitter_pull_retrieve($twitkey, $num_items = NULL) {
+function twitter_pull_retrieve($twitkey, $num_items = NULL, $page) {
   // If $num_items is not set, use the default value.
   // This value is checked more rigorously in twitter_puller->check_arguments().
   $num_items = (intval($num_items) > 0) ? intval($num_items) : twitter_pull_num_items();
 
   // Cached value is specific to the Twitter key and number of tweets retrieved.
-  $cache_key = $twitkey . '::' . $num_items;
+  $cache_key = $twitkey . '::' . $num_items . '::' . $page;
   $cache = cache_get($cache_key, TWITTER_PULL_CACHE_TABLE);
 
   $tweets = array();
@@ -114,7 +114,7 @@ function twitter_pull_retrieve($twitkey,
   }
   else {
     try {
-      $puller = new twitter_puller($twitkey, $num_items);
+      $puller = new twitter_puller($twitkey, $num_items, $page);
       $puller->get_items();
       $tweets = $puller->tweets;
     }
