se JSON::MaybeXS;
use WWW::FBX;
my $fbx;
my $store = 'app_token';
my $conn = {
app_id => "APP ID",
app_name => "APP NAME",
app_version => "1.0",
device_name => "debian",
};
my $json;
cute given command (JSON or not)
local $Data::Dumper::Sortkeys = 1;
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Deepcopy = 1;
if (eval { $json = from_json( $ARGV[0]) } ) {
$res = $fbx->$cmd($json);
} else {
$res = $fbx->$cmd(@ARGV);
}
print Dumper $res unless $quiet;
}
};
if ( my $err = $@ ) {
die $@ unless blessed $err && $err->isa('WWW::FB
s = $fbx->rename( { src => "/Disque dur/a.txt", dst => "b.txt' } );
=head3 download RAW file not JSON!
$res = $fbx->download_file("Disque dur/Photos/cyril/DSCF4322.JPG");
=head2 ftp
=head3 ftp co
suff};
my $uri = URI->new( $self->base_url . "$_api_url/$path");
return $self->_json_request(
$options{method},
$uri,
$args,
$options{
package WWW::FBX;
use Moose;
use Carp::Clan qw/^(?:WWW::FBX|Moose|Class::MOP)/;
use JSON::MaybeXS;
use Scalar::Util qw/reftype/;
use URI::Escape;
use HTTP::Request::Common;
use WWW::FBX::Error;
use En
'Bool', is => 'ro', default => 0 );
has _json_handler => (
is => 'rw',
default => sub { JSON->new->allow_nonref },
handles => { from_json => 'decode' },
);
sub _set_debug {
m
$self = shift;
my $ua = LWP::UserAgent->new(%{$self->lwp_args});
return $ua;
}
sub _json_request {
my ($self, $http_method, $uri, $args, $content_type ) = @_;
my $msg = $self->