use WWW::PSN;
use Data::Dumper;
use JSON;
use Encode;

$json = JSON->new->allow_nonref;
my $profile = profile('hajimuc');
print $json->pretty->encode($profile);
print "Level: $profile->{'curLevel'}\n";

my $detailed_trophies = trophies('hajimuc');
print $json->pretty->encode($detailed_trophies);
for my $t ( @{$detailed_trophies->{list}} ) {
    print encode('utf-8',$t->{title}), "\n";
}
