#!/usr/bin/perl -w # # written by Espen Holm Nilsen (20090519) # be sure to check out my blog at http://www.gho.no/ # use Net::Twitter; if(scalar(@ARGV) > 0 && $ARGV[0] eq 'config') { print "graph_title TwitterFriends\n"; print "graph_category Social\n"; print "graph_vlabel Twittrers\n"; print "graph_scale no\n"; print "friends.label Friends\n"; print "followers.label Followers\n"; exit(0); } my $username = 'twitteruser'; # replace with username my $password = 'twitterpassword'; # replace with password my $twitter = Net::Twitter->new({username=>$username,password=>$password}); my @user = $twitter->verify_credentials(); my $friends_count = $user[0]->{'friends_count'}; my $followers_count = $user[0]->{'followers_count'}; print "friends.value " . $friends_count . "\n"; print "followers.value " . $followers_count . "\n"