in reply to Did I use Net::Twitter::lite correctly for moving lists between accounts?

I'm not into Twitter, and I never will be, but curiosity got the better of me. I fiddled with the first script, made some adjustments, and ran it. I kept getting
Rate limit exceeded. Clients may not make more than 150 requests per h +our
Another reason why I find Twitter annoying:). Here's what I tried:
#!/usr/bin/perl use strict; use warnings; use Net::Twitter::Lite; use Data::Dumper; #use lib '../../files/perl/lib'; #use Base::Roots qw(get_data); #use Base::Nifty qw(filify); my $directory = 'personal/Twitter'; my $file_die = q[Can't open the file]; my $twit_id = 'Lady_Aleena'; my $nt = 'Net::Twitter::Lite'->new( 'consumer_key', 'in the code', 'consumer_secret', 'in the code', 'access_token', 'in the code', 'access_token_secret', 'in the code' ); my (%twitter_lists) = ( 'Andromeda', { 'network', 'unknown' }, 'Babylon 5', { 'network', 'unknown' }, 'Body of Proof', { 'network', 'ABC' }, 'Bones', { 'network', 'FOX' }, 'Buffy and Angel', { 'network', 'unknown' }, 'Burn Notice', { 'network', 'USA' }, 'Castle', { 'network', 'ABC' }, 'Chuck', { 'network', 'NBC' }, 'Covert Affairs', { 'network', 'USA' }, 'Doctor Who', { 'network', 'BBC' }, 'ER', { 'network', 'NBC' }, 'Eureka Warehouse13 Alphas', { 'network', 'Syfy' }, 'Firefly', { 'network', 'unknown' }, 'Haven', { 'network', 'Syfy' }, 'Law & Order', { 'network', 'NBC' }, 'Leverage', { 'network', 'TNT' }, 'Necessary Roughness', { 'network', 'USA' }, 'No Ordinary Family', { 'network', 'ABC' }, 'Rizzoli & Isles', { 'network', 'TNT' }, 'Sanctuary', { 'network', 'Syfy' }, 'seaQuest', { 'network', 'NBC' }, 'Stargate', { 'network', 'Syfy' }, 'Star Trek', { 'network', 'unknown' }, 'Studio 60', { 'network', 'NBC' }, 'White Collar', { 'network', 'USA' }, 'The X-Files & Millennium', { 'network', 'FOX' } ); my @raw_lists; for ( my $cursor = -1 ; $cursor ; ) { my $r = $nt->get_lists( { 'user', $twit_id, 'cursor', $cursor } ); push @raw_lists, @{ $$r{'lists'}; }; $cursor = $$r{'next_cursor'}; } my @lists; foreach my $list (@raw_lists) { my $name = $$list{'name'}; $twitter_lists{$name}{'name'} = $name; $twitter_lists{$name}{'slug'} = $$list{'slug'}; $twitter_lists{$name}{'id'} = $$list{'id'}; $twitter_lists{$name}{'mode'} = $$list{'mode'}; $twitter_lists{$name}{'description'} = $$list{'description'}; push @lists, $$list{'slug'}; } my %raw_lists_follows; foreach my $list (@lists) { for ( my $cursor = -1 ; $cursor ; ) { my $r = $nt->list_members( $twit_id, $list, { 'cursor', $curso +r } ); push @{ $raw_lists_follows{$list}{'following'}; }, @{ $$r{'use +rs'}; }; $cursor = $$r{'next_cursor'}; } for ( my $cursor = -1 ; $cursor ; ) { my $r = $nt->list_subscribers( $twit_id, $list, { 'cursor', $c +ursor } ); push @{ $raw_lists_follows{$list}{'followers'}; }, @{ $$r{'use +rs'}; }; $cursor = $$r{'next_cursor'}; } } sub get_list_name { my ($slug) = @_; foreach my $twitter_list ( keys %twitter_lists ) { if ( $twitter_lists{$twitter_list} eq $slug ) { return $twitter_list; } } } foreach my $raw_list ( keys %raw_lists_follows ) { my $list = get_list_name($raw_list); foreach my $following ( @{ $raw_lists_follows{$raw_list}{'followin +g'}; } ) { my $name = $$following{'name'}; $twitter_lists{$list}{'following'}{$name}{'name'} = $name; $twitter_lists{$list}{'following'}{$name}{'screen_name'} = $$following{'screen_name'}; $twitter_lists{$list}{'following'}{$name}{'id'} = $$following{ +'id'}; } foreach my $followers ( @{ $raw_lists_follows{$raw_list}{'follower +s'}; } ) { my $name = $$followers{'name'}; $twitter_lists{$list}{'followers'}{$name}{'name'} = $name; $twitter_lists{$list}{'followers'}{$name}{'screen_name'} = $$followers{'screen_name'}; $twitter_lists{$list}{'followers'}{$name}{'id'} = $$followers{ +'id'}; } } my @twitter_list_file_lines; foreach my $twitter_list ( sort keys %twitter_lists ) { my $list_name = $twitter_lists{$twitter_list}{'name'}; my $list_slug = $twitter_lists{$twitter_list}{'slug'}; my $list_id = $twitter_lists{$twitter_list}{'id'}; my $list_description = $twitter_lists{$twitter_list}{'description' +}; my $list_network = $twitter_lists{$twitter_list}{'network'}; push my @twitter_list_file_lines, "$list_name|$list_slug|$list_id|$list_description|$list_network" +; foreach my $follow ( 'following', 'followers' ) { $directory .= 'lists/' . filify($list_name); my $people_list_file_name = filify("$list_name/$follow.txt"); my (@person_list_lines) = (); foreach my $person ( sort keys %{ $twitter_lists{$twitter_list}{$fol +low}; } ) { my $follow_name = $twitter_lists{$twitter_list}{$follow}{$person}{'name'}; my $follow_screen_name = $twitter_lists{$twitter_list}{$follow}{$person}{'screen_ +name'}; my $follow_id = $twitter_lists{$twitter_list}{$follow}{$person}{'id'}; push @person_list_lines, "$follow_name|$follow_screen_name|$follow_id"; } my $file = get_data( $directory, $people_list_file_name ); die $@ unless open my $people_list_file, '>', $file; print $people_list_file join( "\n", @person_list_lines ); close $people_list_file; } } my $file = get_data( $directory, 'twitter_list.txt' ); die $@ unless open my $twitter_list_file, '>', $file; print $twitter_list_file join( "\n", @twitter_list_file_lines ); close $twitter_list_file; sub filify { eval print $_; } sub get_data { eval print $_; }