Skip to content

Instantly share code, notes, and snippets.

@sugyan
Created November 26, 2009 14:13
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 sugyan/243478 to your computer and use it in GitHub Desktop.
Save sugyan/243478 to your computer and use it in GitHub Desktop.
#!/opt/local/bin/perl
use strict;
use warnings;
use Config::Pit;
use Date::Parse 'str2time';
use Net::Twitter;
my $nt = Net::Twitter->new(%{pit_get(
"twitter.com",
require => {
"username" => "your username on twitter",
"password" => "your password on twitter",
},
)});
my %result = ();
for my $page (1..5) {
my $mentions = $nt->mentions({
count => 200,
page => $page,
});
for my $status (@$mentions) {
my @date = localtime str2time($status->{created_at});
next if $date[4] != 10;
$result{$date[3]}++;
}
}
print "$_: $result{$_}\n" for sort { $a <=> $b } keys %result;
1: 14
2: 6
3: 11
4: 15
5: 20
6: 28
7: 11
8: 27
9: 44
10: 38
11: 26
12: 16
13: 45
14: 32
15: 33
16: 35
17: 39
18: 27
19: 21
20: 18
21: 20
22: 6
23: 10
24: 22
25: 16
26: 171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment