Daily Archives: January 6, 2010

Friendly Followers and Followings of Friends on Twitter

Jay Gold wrote a good blog entry entitled ‘Follow Back: How I Choose Who to Follow on Twitter’.

Jay has some really good points and a nice strategy for his tweeteria.

I am not a big fan of the whole follow me and I follow you back. You might not find my tweets interesting even though I find yours. This has a side effect that I always have more followers than friends, simply because I cannot control how many people choose to follow me and I only add people whom I would like to follow, since their tweets are of interest to me – well that and I am a lazy bastard.

Web Upd8 had an article on ReFollow.com an online service to manage your Twitter friends and followers. The service helps you to get a nice picture of your friends and followers and who are both friends and followers.

Anyway, due to my lazy attitude I actually wrote up a Perl application prior to trying out ReFollow.com. So here it is if you are interested. The application show you your friends, followers and people in both groups, so you can easily identify people whom you follow, but you do not follow and vice versa.

  1. #!/usr/bin/perl
  2. # $Id$
  3. use strict;
  4. use warnings;
  5. use Getopt::Long;
  6. use Pod::Usage;
  7. use Net::Twitter::Lite;
  8. use List::MoreUtils qw(any);
  9. use English qw( -no_match_vars );
  10. my $username;
  11. my $password;
  12. GetOptions( 'username=s' => \$username, 'password=s' => \$password );
  13. if ( not $username ) {
  14. pod2usage(1);
  15. }
  16. if ( not $password ) {
  17. print "Please provide password: ";
  18. $password = <STDIN>;
  19. chomp $password;
  20. }
  21. my $nt = Net::Twitter::Lite->new(
  22. username => $username,
  23. password => $password,
  24. );
  25. my $friends_list = $nt->friends();
  26. my $followers_list = $nt->followers();
  27. $friends_list = $nt->friends();
  28. $followers_list = $nt->followers();
  29. };
  30. if ($EVAL_ERROR) {
  31. die “Unable to connect to twitter - $EVAL_ERROR;
  32. }
  33. my @friends = map { $_->{screen_name} } @{$friends_list};
  34. my @friends_and_followers;
  35. my @followers;
  36. my $i = 0;
  37. for my $follower ( @{$followers_list} ) {
  38. if ( any { $_ eq $follower->{screen_name} } @friends ) {
  39. push @friends_and_followers, $follower->{screen_name};
  40. }
  41. push @followers, $follower->{screen_name};
  42. $i++;
  43. }
  44. print “Friends and Followers (. scalar @friends_and_followers .):\n;
  45. print join,, @friends_and_followers;
  46. print\n\nFriends (. scalar @friends .):\n;
  47. print join,, @friends;
  48. print\n\nFollowers (. scalar @followers .):\n;
  49. print join,, @followers;
  50. print\n;
  51. exit 0;
  52. __END__
  53. =pod
  54. =head1 NAME
  55. twitter.pl - CLI twitter client
  56. =head1 SYNOPSIS
  57.   twitter.pl [options]
  58.   Options:
  59.   --username <username>
  60.   --password <password>
  61. =head1 OPTIONS
  62. =over 8
  63. =item B<--username> Twitter username, this parameter is mandatory
  64. =item B<--password> Twitter password, this parameter is optional, if not provided you will be prompted for a password.
  65. =back

iPhone Photo Weirdness

I have taken a few pictures with my iPhone, sometimes I accidentally move the camera too fast after clicking the button. This renders some weird results – see for yourself

IMG_0064.png

Second picture to document how it actually looks

IMG_0065.png