genzouw/xmlrpc-wordpress-api

There is no license information available for the latest version (dev-master) of this package.

wordpress post from commad-line.

dev-master 2020-05-24 14:18 UTC

This package is auto-updated.

Last update: 2021-03-24 17:37:37 UTC


README

rolenweb/xml-rpc-wordpress-api liberay wapper for Wide Char (ex: Japanese)

Description

Please contact me anytime if you have a problem or request! My information is posted at the bottom of this document.

Requirements

  • PHP
  • Composer

Installation

composer global require genzouw/xmlrpc-wordpress-api

Usage

Post a new entry.

cat <<'EOF' > wp-post.php
#!/usr/bin/env php
<?php

require getenv('HOME') . '/.composer/vendor/autoload.php';

use Genzouw\Wpapi\Wp;

$wp = new Wp(getenv('WP_URL'), getenv('WP_USER'), getenv('WP_PASSWORD'));

$lines = explode("\n", file_get_contents('php://stdin'));

$wp->newPost(array(
    'post_type' => 'post',
    'post_content' => implode(PHP_EOL, array_slice($lines, 2)),
    'post_title' => preg_replace('/^# +/su', '', $lines[0]),
    'post_status' => 'draft',
));
EOF

cat <<'EOF' | php ./wp-post.php
TITLEほげほげ

BODY1
BODY2
BODY3
EOF

Relase Note

date version note
2020-05-24 0.1 first release.

License

This software is released under the MIT License, see LICENSE.

Help

Got a question ?

File a Github issue, send an email to genzouw@gmail.com or tweet to @genzouw on Twitter.

Author Information

genzouw