App-pod2wp

 view release on metacpan or  search on metacpan

script/pod2wp  view on Meta::CPAN

#!perl

# Note: This script is a CLI for Riap function /App/pod2wp/pod2wp
# and generated automatically using Perinci::CmdLine::Gen version 0.498

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2021-05-25'; # DATE
our $DIST = 'App-pod2wp'; # DIST
our $VERSION = '0.005'; # VERSION

use 5.010001;
use strict;
use warnings;
use Log::ger;

use Perinci::CmdLine::Any;

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/App/pod2wp/pod2wp",
    program_name => "pod2wp",
    log => 1,
);

$cmdline->run;

# ABSTRACT: Publish POD document to WordPress as blog post
# PODNAME: pod2wp

__END__

=pod

=encoding UTF-8

=head1 NAME

pod2wp - Publish POD document to WordPress as blog post

=head1 VERSION

This document describes version 0.005 of pod2wp (from Perl distribution App-pod2wp), released on 2021-05-25.

=head1 SYNOPSIS

Usage:

 % pod2wp [--comment-status=s] [--config-path=path | -c]
     [--config-profile=profile | -P] [--debug] [--dry-run | -n]
     [--extra-attr key=s] [--extra-attrs-json=s] [--format=name] [--json]
     [--log-level=level] [--(no)naked-res] [--no-config | -C] [--no-env]
     [--no-publish] [--nopublish] [--page-result[=program]] [--password=s]
     [--proxy=s] [--publish] [--quiet] [--schedule=s] [--trace]
     [--username=s] [--verbose] [--view-result[=program]] <filename>

=head1 DESCRIPTION

This is like L<org2wp> except that instead of Org as the document format,
this program uses POD.

To use this program, first create C<~/pod2wp.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>.

To create a blog post, write your POD document (e.g. in C<post1.pod>) using this
format:

 =for pod2wp TITLE: Blog post title
 
 =for pod2wp CATEGORY: cat1, cat2
 
 =for pod2wp TAGS: tag1,tag2,tag3
 
 =head1 Some header
 
 Text of your post ...
 ...

then:

 % pod2wp post1.pod

this will create a draft post. To publish directly:

 % pod2wp --publish post1.pod

Note that this will also modify your POD file and insert this paragraph at the
top:

 =for pod2wp POSTID: 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:

 % pod2wp post1.pod

You can use C<--publish> to publish the post, or C<--no-publish> to revert it to
draft.

To set more attributes:

 % pod2wp post1.pod --comment-status open \
     --extra-attr ping_status=closed --extra-attr sticky=1

Another example, to schedule a post in the future:

 % pod2wp post1.pod --schedule 20301225T00:00:00



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