#!perl
use strict;
use warnings;
use WWW::Facebook::API::Simple;

my $client = WWW::Facebook::API::Simple->new(
    desktop => 1,
    # if you have a web app key, change to 
    # desktop => 0,
    throw_errors => 1,
);

my $token = $client->auth->create_token;
$client->login->login( $token ); # prompts for login credentials from STDIN
$client->auth->get_session( auth_token => $token );
my @friends = @{ $client->friends->get };
use Data::Dumper;
print Dumper $client->friends->are_friends(
    uids1 => [@friends[0,1,2,3]],
    uids2 => [@friends[4,5,6,7]],
);
print 'You have '
    . $client->notifications->get->{pokes}->[0]->{unread}->[0]
    .' unread poke(s).';
my @quotes = map { @{$_->{quotes}} }
    @{$client->users->get_info( uids => \@friends, fields => ['quotes'] ) };
print 'A lot of quotes: '.@quotes."\n";
print "Random one:\t".$quotes[int rand @quotes]."\n";


$client->auth->logout;
