Wednesday, 7 September 2005

Blogging from the command line (2)

The key to this is cURL, which comes with Linux and Mac OS X. You'll need to have secure support, because you post to Blogger using HTTPS.

First you need to find out your Blog ID, using this command:

curl --basic --user blogger_username:blogger_password

Now that you have that ID, you can post by the following command (this exploits Bash's here documents):

curl -X POST -T - -H "Content-type: application/xml" --basic --user blogger_username:blogger_password <<END

an XML document following these instructions.


With that second one, you might want to wrap that up in a script, but hey, remote HTML posting (didn't find a picture upload in the API though).