File: find_friend

package info (click to toggle)
libwww-myspace-perl 0.82-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 728 kB
  • ctags: 170
  • sloc: perl: 4,646; makefile: 10
file content (20 lines) | stat: -rwxr-xr-x 468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w -I../lib
# find_friend email
# Prints the friendID(s) for the provided email
#
# Example:
# find_friend your@email.com

use WWW::Myspace;
my $myspace=new WWW::Myspace( auto_login=>0 );

my $email = shift;
my ( @friend_ids ) = $myspace->find_friend( $email );

if ( $myspace->error ) {
   die $myspace->error;
} elsif ( @friend_ids ) {
   print "${email}'s friendID is @friend_ids\n";
} else {
   print "Don't think $email is on myspace, sorry\n";
}