Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 74d583100caff71446c163dd8ca777c392459a74 1 parent bb9552b
@davorg authored
Showing with 14 additions and 9 deletions.
  1. +14 −9 build.pl
View
23 build.pl
@@ -27,14 +27,19 @@
exit();
}
-#my $follows = autofollow($t);
-
-#exit unless $follows;
-
-my $members = $t->list_members({
- owner_screen_name => 'balhamtwits',
- slug => 'balhamites',
-});
+my $list_members;
+my $cursor = -1;
+
+while ($cursor) {
+ my $members = $t->list_members({
+ owner_screen_name => 'balhamtwits',
+ slug => 'balhamites',
+ cursor => $cursor,
+ });
+
+ $cursor = $members->{next_cursor};
+ push @$list_members, @{$members->{users}};
+}
my $tweets = $t->list_statuses({
owner_screen_name => 'balhamtwits',
@@ -43,7 +48,7 @@
my $tt = Template->new;
$tt->process('index.tt',
- { tweets => $tweets, cfg => $config, follows => $members->{users} },
+ { tweets => $tweets, cfg => $config, follows => $list_members },
'index.html',
{binmode => ':utf8'})
or die $tt->error;
Please sign in to comment.
Something went wrong with that request. Please try again.