categories: design
web
dev
near life experience

posting to wordpress via the command line

January 20th, 2008

I tackled this problem via XMLRPC and perl.
I ended up packaging this under WordPress::Post on cpan.

Usage examples:

wppost -t 'title of the post' -c stuff,fruit,cake -i 'This is what I think of bla.'

You can also write a text file, the name of the text file is the title.

wppost -i ./path/to/title_of_the_post.txt

This program is in its infancy. But dammit, it works. It’s how I posted this content via the command like. Also, you can include images in your posts. Multiple images. Via the command line.
Anything not in the argument is considered posting content..
So what if your post if about a party you went to, and you have 5 pictures..

First write your halloween_party.txt file, then have your photos lined up somewhere.. then..

wppost -i halloween_party.txt ./images/halloween_photos_post/*jpg

Done. Linux rocks.

Leave a Reply