]>
iEval git - www-backpacktf.git/blob - User.pm
3120bcbc20c9ed083b802040880b820df55f6480
1 package WWW
::BackpackTF
::User
;
6 our $VERSION = '0.001';
9 my ($class, $content) = @_;
10 bless $content, $class
13 sub steamid
{ shift->{steamid
} }
14 sub name
{ shift->{name
} }
15 sub reputation
{ shift->{backpack_tf_reputation
} }
16 sub group
{ shift->{backpack_tf_group
} }
17 sub positive
{ shift->{backpack_tf_trust
}->{for} // 0 }
18 sub negative
{ shift->{backpack_tf_trust
}->{against
} // 0 }
19 sub scammer
{ shift->{steamrep_scammer
} }
20 sub banned_backpack
{ shift->{backpack_tf_banned
} }
21 sub banned_economy
{ shift->{ban_economy
} }
22 sub banned_community
{ shift->{ban_community
} }
23 sub banned_vac
{ shift->{ban_vac
} }
24 sub notifications
{ shift->{notifications
} }
25 sub value
{ shift->{backpack_value
}->{shift // WWW
::BackpackTF
::TF2
} }
26 sub update
{ shift->{backpack_update
}->{shift // WWW
::BackpackTF
::TF2
} }
30 $self->banned_backpack || $self->banned_community || $self->banned_economy || $self->banned_vac
40 WWW::BackpackTF::User - Class representing user profile information
44 my $user = $bp->get_users($user_id);
45 say 'Steam ID: ', $user->steamid;
46 say 'Name: ', $user->name;
47 say 'Reputation: ', $user->reputation;
48 say 'Part of backpack.tf Steam Group: ', ($user->group ? 'YES' : 'NO');
49 say 'Positive trust ratings: ', $user->positive;
50 say 'Negative trust ratings: ', $user->negative;
51 say 'Scammer (according to steamrep.com): ', ($user->scammer ? 'YES' : 'NO');
52 say 'Banned from backpack.tf: ', ($user->banned_backpack ? 'YES' : 'NO');
53 say 'Economy banned: ', ($user->banned_economy ? 'YES' : 'NO');
54 say 'Community banned: ', ($user->banned_community ? 'YES' : 'NO');
55 say 'VAC banned: ', ($user->banned_vac ? 'YES' : 'NO');
56 say 'Banned on any of the previous: ', ($user->banned ? 'YES' : 'NO');
57 say 'Unread notifications: ', $user->notifications;
58 say 'Value of TF2 backpack: ', $user->value(WWW::BackpackTF::TF2);
59 say 'Value of Dota 2 backpack: ', $user->value(WWW::BackpackTF::DOTA2);
60 say 'Last TF2 backpack update: ', $user->update(WWW::BackpackTF::TF2);
61 say 'Last Dota 2 backpack update: ', $user->update(WWW::BackpackTF::DOTA2);
66 WWW::BackpackTF::User is a class representing user profile information.
74 Returns this user's Steam ID.
78 Returns this user's persona name.
82 Returns this user's backpack.tf reputation.
86 Returns true if this user is part of the backpack.tf Steam group.
90 Returns the number of positive trust ratings this user has.
94 Returns the number of negative trust ratings this user has.
98 Returns true if this user is a scammer according to L<http://steamrep.com/>
100 =item B<banned_backpack>
102 Returns true if this user is banned from backpack.tf.
104 =item B<banned_economy>
106 Returns true if this user is economy banned.
108 =item B<banned_community>
110 Returns true if this user is community banned.
114 Returns true if this user is banned by Valve Anti-Cheat.
118 Returns true if any of the B<banned_*> methods returns true.
120 =item B<notifications>
122 Returns the number of unread notifications this user has.
124 =item B<value>([I<game>])
126 Returns the total value of this user's backpack for the specified game, in the lowest currency. I<game> defaults to C<WWW::BackpackTF::TF2>.
128 =item B<update>([I<game>])
130 Returns the UNIX timestamp of this user's last backpack update for the specified game. I<game> defaults to C<WWW::BackpackTF::TF2>
136 L<http://backpack.tf/api/users>
140 Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
142 =head1 COPYRIGHT AND LICENSE
144 Copyright (C) 2014, 2015 by Marius Gavrilescu
146 This library is free software; you can redistribute it and/or modify
147 it under the same terms as Perl itself, either Perl version 5.18.2 or,
148 at your option, any later version of Perl 5 you may have available.
This page took 0.05767 seconds and 3 git commands to generate.