App-html2wp
view release on metacpan or search on metacpan
script/html2wp view on Meta::CPAN
#!perl
# Note: This script is a CLI for Riap function /App/html2wp/html2wp
# and generated automatically using Perinci::CmdLine::Gen version 0.496
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2020-05-01'; # DATE
our $DIST = 'App-html2wp'; # DIST
our $VERSION = '0.004'; # VERSION
use 5.010001;
use strict;
use warnings;
use Log::ger;
use Perinci::CmdLine::Any;
my $cmdline = Perinci::CmdLine::Any->new(
url => "/App/html2wp/html2wp",
program_name => "html2wp",
log => 1,
);
$cmdline->run;
# ABSTRACT: Publish HTML document to WordPress as blog post
# PODNAME: html2wp
__END__
=pod
=encoding UTF-8
=head1 NAME
html2wp - Publish HTML document to WordPress as blog post
=head1 VERSION
This document describes version 0.004 of html2wp (from Perl distribution App-html2wp), released on 2020-05-01.
=head1 SYNOPSIS
Usage:
% html2wp [--comment-status=s] [--config-path=path | -c] [--config-profile=profile | -P] [--debug] [--dry-run] [--extra-attr key=s] [--extra-attrs-json=s] [--format=name] [--json] [--log-level=level] [--(no)naked-res] [--no-config | -C] [--no-env] [...
=head1 DESCRIPTION
To use this program, first create C<~/html2wp.conf> containing the API
credentials, e.g.:
proxy=https://YOURBLOGNAME.wordpress.com/xmlrpc.php
username=YOURUSERNAME
password=YOURPASSWORD
You can also put multiple credentials in the configuration file using profile
sections, e.g.:
[profile=blog1]
proxy=https://YOURBLOG1NAME.wordpress.com/xmlrpc.php
username=YOURUSERNAME
password=YOURPASSWORD
[profile=blog2]
proxy=https://YOURBLOG2NAME.wordpress.com/xmlrpc.php
username=YOURUSERNAME
password=YOURPASSWORD
and specify which profile you want using command-line option e.g.
C<--config-profile blog1>.
then:
% html2wp post1.html
(You should provide blog post title in your HTML in the C<< E<lt>titleE<gt> >> or C<< E<lt>meta
name="title" content="..."E<gt> >>. You can also put categories in C<< E<lt>meta
name="categories" content="cat1,cat2,..."E<gt> >> and tags in C<< E<lt>meta name="tags"
content="tag1,tag2,..."E<gt> >>.)
The above command will create a draft post. To publish directly:
% html2wp post1.html ... --publish
Note that this will also modify your HTML file and insert this element at the
beginning of the document:
<meta name="postid" content="1234">
where 1234 is the post ID retrieved from the server when creating the post.
After the post is created, you can update using the same command:
% html2wp post1.html
You can use C<--publish> to publish the post, or C<--no-publish> to revert it to
draft.
To set more attributes:
% html2wp post1.html ... --comment-status open \ --extra-attr
ping_status=closed --extra-attr sticky=1
Another example, to schedule a post in the future:
% html2wp post1.html --schedule 20301225T00:00:00
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--comment-status>=I<s>
( run in 0.706 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )