Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use cursor to get all list members for list of twitter handles.

  • Loading branch information...
commit 74d583100caff71446c163dd8ca777c392459a74 1 parent bb9552b
Dave Cross authored July 20, 2013

Showing 1 changed file with 14 additions and 9 deletions. Show diff stats Hide diff stats

  1. 23  build.pl
23  build.pl
@@ -27,14 +27,19 @@
27 27
   exit();
28 28
 }
29 29
 
30  
-#my $follows = autofollow($t);
31  
-
32  
-#exit unless $follows;
33  
-
34  
-my $members = $t->list_members({
35  
-  owner_screen_name => 'balhamtwits',
36  
-  slug => 'balhamites',
37  
-});
  30
+my $list_members;
  31
+my $cursor = -1;
  32
+
  33
+while ($cursor) {
  34
+  my $members = $t->list_members({
  35
+    owner_screen_name => 'balhamtwits',
  36
+    slug => 'balhamites',
  37
+    cursor => $cursor,
  38
+  });
  39
+
  40
+  $cursor = $members->{next_cursor};
  41
+  push @$list_members, @{$members->{users}};
  42
+}
38 43
 
39 44
 my $tweets = $t->list_statuses({
40 45
   owner_screen_name => 'balhamtwits',
@@ -43,7 +48,7 @@
43 48
 
44 49
 my $tt = Template->new;
45 50
 $tt->process('index.tt',
46  
-             { tweets => $tweets, cfg => $config, follows => $members->{users} },
  51
+             { tweets => $tweets, cfg => $config, follows => $list_members },
47 52
              'index.html',
48 53
              {binmode => ':utf8'})
49 54
   or die $tt->error;

0 notes on commit 74d5831

Please sign in to comment.
Something went wrong with that request. Please try again.