WWW::BackpackTF::Listing - Class representing a classified listing
use WWW::BackpackTF; use Data::Dumper qw/Dumper/; use POSIX qw/strftime/; my $bp = WWW::BackpackTF->new(key => '...'); my $steamid = $ARGV[0]; my @listings = $bp->get_user_listings($steamid); my $listing = $listings[0]; say 'Item: ', Dumper $listing->item; say 'The user is selling this item' if $listing->is_selling; say 'The user is buying this item' if $listing->is_buying; my %currencies = %{$listing->currencies}; say 'Price: ', join ' + ', map { "$currencies{$_} $_" } keys %currencies; say 'Details: ', $listing->details; say 'Created at: ', strftime '%c', localtime $listing->created; say 'Last bumped at: ', strftime '%c', localtime $listing->bump;
WWW::BackpackTF::Listing is a class representing a classified listing.
The item being sold, as a hashref. Contains keys like defindex and quality.
defindex
quality
The price of the listing, as a hashref. The keys are the internal names of the currencies (can be identified using get_currencies in WWW::BackpackTF) and the values are the amounts.
The message on the listing
UNIX timestamp of when the listing was last bumped.
UNIX timestamp of when the listing was created.
The internal ID of the listing.
True if the user is selling this item.
True if the user is buying this item.
1 if the user is selling the item, 0 if the user is buying.
http://backpack.tf/api/IGetPrices
Marius Gavrilescu, <marius@ieval.ro>
Copyright (C) 2014-2017 by Marius Gavrilescu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.
To install WWW::BackpackTF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::BackpackTF
CPAN shell
perl -MCPAN -e shell install WWW::BackpackTF
For more information on module installation, please visit the detailed CPAN module installation guide.