Skip to content

Instantly share code, notes, and snippets.

@walkure
Created March 27, 2012 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walkure/2219063 to your computer and use it in GitHub Desktop.
Save walkure/2219063 to your computer and use it in GitHub Desktop.
find the oldest user in KMC(Kyoto univ. Microcomputer Club) member list
#!/usr/bin/env perl
use strict;
use warnings;
use Date::Parse;
use Net::Twitter::Lite;
my $nt = Net::Twitter::Lite->new(
consumer_key => 'consumer key',
consumer_secret => 'consumer secret',
);
$nt->access_token ('access token');
$nt->access_token_secret('access secret');
my @members;
my $cursor = '-1';
while($cursor ne '0'){
my $aref = $nt->list_members({cursor => $cursor , user=>'seikichi' , list_id => 'kmc'});
$cursor = $aref->{next_cursor};
push(@members,@{$aref->{users}});
}
my %ulist;
foreach my $user(@members){
$ulist{str2time($user->{created_at})} = $user->{screen_name};
}
foreach my $d (reverse sort keys %ulist){
print $ulist{$d}.':'.localtime($d)."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment