App-wp-xmlrpc

 view release on metacpan or  search on metacpan

bin/wp-xmlrpc  view on Meta::CPAN

 password=YOURPASSWORD

 [profile=blog2]
 proxy=https://BLOG2NAME.wordpress.com/xmlrpc.php
 username=YOURUSERNAME
 password=YOURPASSWORD

then:

 % wp-xmlrpc --config-profile blog1 wp.getPost 13

Some of the functions:

 % wp-xmlrpc wp.getPosts ;# list all posts

 % wp-xmlrpc wp.newPost '{"post_content":"This is a test blog post"}' ;# by default will create an untitled blog post with status=draft
 % wp-xmlrpc wp.newPost '{"post_content":"This is a test blog post", "post_status":"publish", "post_title":"Some title"}' ;# set title & status

 % wp-xmlrpc wp.editPost 13 '{"status":"draft"}'

 % wp-xmlrpc wp.deletePost 13


 % wp-xmlrpc wp.getTaxonomies

 % wp-xmlrpc wp.getTaxonomy category
 % wp-xmlrpc wp.getTaxonomy post_tag
 % wp-xmlrpc wp.getTaxonomy post_format
 % wp-xmlrpc wp.getTaxonomy mentions

 % wp-xmlrpc wp.getTerms category ;# get terms (i.e. in this case list of categories)
 % wp-xmlrpc wp.getTerm category 2342 ;# get a specific category by ID
 % wp-xmlrpc wp.getTerm tag 423 ;# get a specific tag by ID

 % wp-xmlrpc wp.newTerm '{"taxonomy":"tag", "name":"tag3"}' ;# create a new tag
 % wp-xmlrpc wp.newTerm '{"taxonomy":"category", "name":"cat2", "description":"Second category", "parent":2342}' ;# create a new category, with description and parent ID

 % wp-xmlrpc wp.editTerm 2345 '{"description":"New description"}' ;# create a category's description

 % wp-xmlrpc wp.deleteTerm 2345


 % wp-xmlrpc wp.getComments ;# list comments
 % wp-xmlrpc wp.getCommentCount 13 ;# get number of comments for a post
 % wp-xmlrpc wp.getComment 9983 ;# get a comment by ID


 % wp-xmlrpc wp.getOptions ;# get all options
 % wp-xmlrpc wp.getOptions '["blog_title","blog_tagline"]' ;# get specified options only
 % wp-xmlrpc wp.setOptions '{"blog_title":"New title", "blog_tagline":"New tagline"}'


 % 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>

=head2 B<wp.editPost>

=head2 B<wp.editProfile>

=head2 B<wp.editTerm>

=head2 B<wp.getAuthors>

=head2 B<wp.getComment>

=head2 B<wp.getCommentCount>

=head2 B<wp.getCommentStatusList>

=head2 B<wp.getComments>

=head2 B<wp.getMediaItem>

=head2 B<wp.getMediaLibrary>

=head2 B<wp.getOptions>

=head2 B<wp.getPost>

=head2 B<wp.getPostFormats>

=head2 B<wp.getPostStatusList>

=head2 B<wp.getPostType>

=head2 B<wp.getPostTypes>

=head2 B<wp.getPosts>

=head2 B<wp.getProfile>

=head2 B<wp.getTaxonomies>

=head2 B<wp.getTaxonomy>

=head2 B<wp.getTerm>

=head2 B<wp.getTerms>

=head2 B<wp.getUser>

=head2 B<wp.getUsers>

=head2 B<wp.getUsersBlogs>



( run in 0.597 second using v1.01-cache-2.11-cpan-39bf76dae61 )