WordPress CLI Blogger

By | | PHP

5

CLI PHP5 – WordPress Blogger – if you use WordPress, gives you a tool to add blog entries from the command line. Be warned has some unique requirements;

- PHP5
- readline
- curl

Total lines of code < 100.

Written By:

Harry Fuecks

Harry has been working in corporate IT since 1994, with everything from start-ups to Fortune 100 companies. Outside of office hours he runs phpPatterns: a site dedicated to software design with PHP that aims to raise standards of PHP development. He also maintains Dynamically Typed: SitePoint's PHP blog.

 

{ 5 comments }

trickie July 9, 2004 at 6:31 am

have updated the tool to use WordPress’s XML-RPC capability. Still uses readline (and now XML-RPC instead of cURL), but check out Andrew’s Windows work around

Andrew-J2000 July 8, 2004 at 8:17 am

This works for Windows.


if(!function_exists('readline')) { //Win32
define('CMD_STDIN', fopen("php://stdin", "r+"));
define('CMD_STDOUT', fopen("php://stdout", "r+"));
function readline ($str=null) {
if ($str!=null) fwrite(CMD_STDOUT, $str);
return trim (fgets (CMD_STDIN, 255));
}
}

trickie July 6, 2004 at 11:32 pm

readline…. yeah the silent mode won’t use readline. Better fix that up!!

trickie July 6, 2004 at 7:23 pm

I’ll be fixing up some stuff this week. Making it more interactive in one mode… and also silent in another (to allow for use in pipes etc)

Tim July 6, 2004 at 6:44 pm

Might also mention that because of the readline requirement, it will not run on Windows

Comments on this entry are closed.