#!/usr/bin/perl use warnings; use strict; use WebService::EveOnline; use Data::Dump qw/ pp /; my $API_KEY = $ENV{EVE_API_KEY}; my $USER_ID = $ENV{EVE_USER_ID}; unless ($API_KEY && $USER_ID) { print "Please export EVE_API_KEY and EVE_USER_ID before running\n"; exit; } my $eve = WebService::EveOnline->new( { user_id => $USER_ID, api_key => $API_KEY } ); my $wanted = $ARGV[0] || undef; my $show_max = $ARGV[1] || 5; foreach my $char ($eve->characters) { next if $wanted && $wanted ne $char->name; my @assets = $char->assets; my $num_assets = scalar(@assets); my $max = ($num_assets >= $show_max) ? $show_max : $num_assets; if ($num_assets == 0) { print "Sadly, " . $char->name . " has no assets\n\n"; next; } print $char->name . "'s assets:\n"; foreach my $t (@assets) { next if $max-- <= 0; print " " . $t->quantity . " x " . $t->name . " (" . $t->group . "/" . $t->category . ") in " . $t->location . "\n"; if ($t->container) { print " containing:\n"; foreach my $i ($t->container) { print " " . $i->quantity . " x " . $i->name . " (" . $i->group . "/" . $i->category . ")\n"; } } } print "\n"; }