You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
818 B
18 lines
818 B
#!/usr/bin/perl -w
|
|
use Net::Twitter;
|
|
use strict;
|
|
$|++;
|
|
|
|
my ($username,$password) = @ARGV;
|
|
my $user = Net::Twitter->new({username => $username, password => $password });
|
|
my ($friends,$followers) = ($user->friends(), $user->followers());
|
|
my ($num_friends, $num_followers) = ($#$friends, $#$followers);
|
|
my ($friends_followers,$followers2) = (0,0);
|
|
|
|
map { $friends_followers += $_->{followers_count} } (@$friends);
|
|
map { $followers2 += $_->{followers_count} } (@$followers);
|
|
|
|
print "You have $num_friends friends and $num_followers followers\n";
|
|
printf "Friend/Follow Ratio: %.2f\n", $num_friends/$num_followers;
|
|
printf "Avg Friend Follow Count: %.1f\n", $friends_followers / $num_friends;
|
|
printf "Avg Follower Follow Count: %.1f\n", $followers2 / $num_followers;
|
|
|