App-wp-xmlrpc
view release on metacpan or search on metacpan
bin/wp-xmlrpc view on Meta::CPAN
% wp-xmlrpc wp.getProfile
% wp-xmlrpc wp.editProfile '{"bio":"Blah blah blah"}'
=head1 DESCRIPTION
This script is a thin layer of CLI over WordPress XML-RPC API, mainly for
testing/debugging. Each CLI subcommand is for calling API method of the same
name. If an argument starts with C<{> it will be assumed as a JSON-encoded hash
and will be decoded. If an argument starts with C<[> it will be assumed as a
JSON-encoded array and will be decoded.
=head1 SUBCOMMANDS
=head2 B<wp.deleteComment>
=head2 B<wp.deletePost>
=head2 B<wp.deleteTerm>
=head2 B<wp.editComment>
lib/App/wp/xmlrpc.pm view on Meta::CPAN
},
password => {
schema => 'str*',
req => 1,
cmdline_aliases => {p=>{}},
tags => ['common'],
},
);
# for each non-common arg, if the arg's value starts with '[' or '{' then it
# will be assumed to be JSON and will be JSON-decoded.
sub _convert_args_to_struct {
require JSON::MaybeXS;
my $args = shift;
for my $k (keys %$args) {
next if $args_common{$k};
next unless $args->{$k} =~ /\A(?:\[|\{)/;
eval { $args->{$k} = JSON::MaybeXS::decode_json($args->{$k}) };
die "Invalid JSON in '$k' argument: $@\n" if $@;
}
( run in 0.306 second using v1.01-cache-2.11-cpan-26ccb49234f )