The Accidental Rubyist

invalid byte sequence in UTF-8

Simple Drupal Blog Poster (ruby xmlrpc)

leave a comment »

After yesterday’s struggle getting ruby 1.8.5 to do a post with drupal, today i quickly put together a simple drupal poster. It posts a new post, and can update the same.
Its a Simple poster in the sense that it takes a file in the following minimal format:
first line is subject
rest is content.
In the case of editing (updating a post), first line must be POSTID: <postid>.
That’s it — no categories etc.

For a full-fledged drupal/MT poster, please use mtsend.py. If you are having problems with ruby and drupal, pls see the previous post. A minor change or 2 is required in the xmlrpc/client.rb. I am posting to an old version of drupal, perhaps the new versions correctly return Content-Type as “text/xml, and not html.
DOWNLOAD drupalpost.rb.
~~~
“If you want to travel around the world and be invited to speak at a lot
of different places, just write a Unix operating system.”
(By Linus Torvalds)

Advertisements

Written by totalrecall

March 19, 2007 at 12:44 am

Posted in blogging, ruby

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: