Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use Net::Twitter;
  3.  
  4. $user = shift ;
  5. $pass = shift ;
  6. #slug of the list, not the name, mind you ....
  7. $list = shift ;
  8.  
  9. $user2 = shift ;
  10. $pass2 = shift ;
  11. #slug of the list, not the name, mind you ....
  12. $list2 = shift ;
  13.  
  14.  
  15. my $nt = Net::Twitter->new(
  16. traits => [qw/API::Lists/, 'InflateObjects'],
  17. decode_html_entities => 1,
  18. username => $user,
  19. password => $pass );
  20.  
  21. my @members;
  22. for ( my $cursor = -1; $cursor; ) {
  23. my $r = $nt->list_members($user, $list, { cursor => $cursor });
  24. push @members, @{$r->users};
  25. $cursor = $r->next_cursor; }
  26.  
  27. my $new = Net::Twitter->new(
  28. traits => [qw/API::REST API::Search API::Lists/],
  29. decode_html_entities => 1,
  30. username => $user2,
  31. password => $pass2 );
  32.  
  33. foreach $tweeter (@members)
  34. {
  35. print $tweeter->{'screen_name'} . "\n" ;
  36. $new->add_list_member($user2, $list2,{id => $tweeter->{id}}) ;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement