WWW::BackpackTF::Item - Class representing item information
use WWW::BackpackTF qw/VINTAGE GENUINE UNUSUAL/; use Data::Dumper qw/Dumper/; my $bp = WWW::BackpackTF->new(key => '...'); my @items = $bp->get_prices; my $item = $items; say 'Name: ', $item->name; say 'Linked defindexes: ', join ' ', $item->defindex; say 'Price of Unique, Tradable, Craftable version: ', $item->price; say 'Price of Vintage, Tradable, Craftable version: ', Dumper $item->price(VINTAGE); say 'Price of Vintage, Non-Tradable, Craftable version: ', Dumper $item->price(VINTAGE, 0); say 'Price of Genuine, Non-Tradable, Non-Craftable version: ', Dumper $item->price(GENUINE, 0, 0); say 'Price of Unusual, Tradable, Craftable version with effect 10: ', Dumper $item->price(UNUSUAL, 1, 1, 10);
WWW::BackpackTF::Item is a class representing price information about an item.
The name of the item.
In list context, a list of defindexes linked to the item. In scalar context, the first such defindex.
- price([$quality, [$tradable, [$craftable, [$priceindex]]]])
The price of an item. Takes four optional arguments: the quality (defaults to 6, which is Unique), the tradability of the item (defaults to true), the craftability of an item (defaults to true), and the priceindex (crate series/unusual effect, defaults to none).
Returns an hashref with the following keys/values:
The currency the item's price is in.
If present, the upper range of the price range.
The price in the lowest currency, without rounding. Only present if get_prices was called with a true value for $raw.
Timestamp of last price update.
The difference bitween the former price and the current price. 0 if the current price is new.
Marius Gavrilescu, <email@example.com>
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.