blogpost README

Updated: 2012-12-31
Updated: 2010-10-28
Updated: 2010-02-17
Published: 2008-05-16

blogpost is a WordPress command-line weblog client. It creates and updates weblog entries directly from AsciiDoc (or HTML) source documents. You can also delete and list weblog entries from the command-line.

  • Manages WordPress Posts and Pages.
  • Automatically uploads media files (images, video, audio).
  • Only posts new or modified media files.

This blogpost command creates a blogpost containing images from an AsciiDoc text file:

$ blogpost.py post blogpost_media_processing.txt

uploading: /home/srackham/doc/blogs/smallnew.png...
url: https://srackham.files.wordpress.com/2008/05/smallnew.png
uploading: /home/srackham/doc/blogs/tiger.png...
url: https://srackham.files.wordpress.com/2008/05/tiger1.png
creating published post 'blogpost media processing'...
id: 93
url: https://srackham.wordpress.com/2008/05/22/blogpost-media-processing/

Status

Latest version in Mercurial repository at Google Code.

See also the blogpost(1) man page.

Current version tested under:

  • Xubuntu 12.04
  • Python 2.7.3

blogpost uses Michele Ferretti’s Python WordPress library and comes with a patched version of the wordpreslib.py library module (the patch added WordPress Page XML-RPC methods).


Prerequisites

  • Python 2.5 or better (has not been tried with earlier versions).
  • AsciiDoc (unless you only plan to source raw HTML documents).

Installation

  • Clone the Mercurial repository at Google Code to your local machine.
  • Put blogpost.py in search path (optional).
  • Install the WordPress backend plugin:
    asciidoc --backend install ./conf/wordpress.zip
  • Create $HOME/.blogpost configuration file (see example conf/blogpost_example.conf).
  • Disable emoticons from the WordPress browser interface (optional):
    1. Login.
    2. Navigate to Settings→Writing→Writing Settings page.
    3. Uncheck Convert emoticons in the Formatting section (this option stops the automatic conversion of text patterns to emoticons).

Note

As of AsciiDoc 8.6.9 the wordpress backend conf file wordpress.conf is no longer included in the AsciiDoc distribution — it’s included here in the blogpost distribution as a backend plugin (conf/wordpress.zip).


Bugs

  • Under some circumstances WordPress converts three periods to an elipsis character and double dashes to the em dashes, there doesn’t seem to be a way to turn this off.
  • WordPress does not appear to recognise list numbering styles and all numbered lists are rendered with decimal numbering (WordPress default theme).
  • WordPress nested unordered lists all have the same bullet style (WordPress default theme).
  • Large posts can result in blank WordPress pages (I experienced this posting the AsciiDoc User Guide which is over five thousand lines long). The problem seems to be with WordPress: http://www.undermyhat.org/blog/2009/07/sudden-empty-blank-page-for-large-posts-with-wordpress/