Creating a Basic Metaweblog API Blogging Client in C#
I'm on a longstanding quest to find a better application from which to build up posts and put them into Wordpress. It's not as big of an issue here, but I'd like to branch out more into some other sites and need some better tools (or better suited to my way of working).
To that end, I've been messing around a bit with building my own power blogging client. I've got a pretty good sized mindmap in Freemind with my outline and requirements for what I want it to do.
What I'm actually after is a powerful tool for researching, composing and publishing posts. That includes keyword research, image gathering, source reading (RSS reading and sorting, etc.), draft capabilities that span multiple computers, advertising or affiliate program integration, etc. All of it included in a "geeky" package without WYSIWYG editing and the other stuff aimed at beginners. There is an ever growing pile of tools that are aimed at that crowd already. And, every one of those tools frustrates me.
So, to build my own. I've been messing with several of the .NET DLL's that are going to make this much easier as well as hooking into Amazon, etc. from C#. It's looking much simpler than I first thought it might be, making this a promising possibility. The DLL that's useful for this particular functionality is the Tortuga.NET library, which actually does lots of useful stuff including reading RSS and posting to Metaweblog API engines.
I thought I'd share just how easy it can be to make a bare bones posting app that just has a few text boxes for entering the title and the raw HTML to the post and a few more for username/password and XMLRPC Url and a button for posting a draft and another for publishing.
From that framework here's all it really takes to post a draft entry into a Metaweblog API compatible engine like Wordpress.
string postId;
Tortuga.MetaWeblog mwlog = new Tortuga.MetaWeblog();
mwlog.Login = username.Text;
mwlog.Password = password.Text;
mwlog.ServiceUrl = xmlrpcurl.Text;
//The last parameter in NewPost is set to false to keep the post as a draft
postId = mwlog.NewPost("0", postTitle.Text, postBody.Text, false);
postTitle.Text = "";
postBody.Text = "";
MessageBox.Show("Posted as post: " + postId);
That's included in the sample project ZIP I put together to help others get started. To keep it quick and easy, the code is just duplicated for the publish or draft function instead of being properly abstracted into the single difference.


June 23rd, 2006 at 11:16 am
Hey, it's my photo
An amusing google-find. Glad you like it.
July 17th, 2006 at 1:26 pm
Your blogging method posts to the default category; any way to change the category of the post ?? any DLL's that let you do that ??
July 25th, 2006 at 7:30 am
Thank you for posting this. I am trying to build my own system for posting articles, and the only XMLRPC package I could find was giving me grief. I'll go try this one now…
February 19th, 2007 at 11:46 pm
Hi, i'm intresting with your example for c# client , could u extend the tutorial , coz it very good .. and btw is bloger api (gdata.client) from google is the same with tortuga ? thank's bye nice to know u
February 20th, 2007 at 3:14 am
I probably won't extend this article. That's because the GData client and the Atom Publishing Protocol that it's based on are MUCH better API's for publishing online. Unfortunately, many of the tools on the server side aren't yet ready for it. GData/Atom is entirely different than the Metaweblog API.
May 2nd, 2009 at 8:33 am
hey man do you have the source code of TortugaDN.dll.
June 2nd, 2009 at 3:25 am
Hi.. Your code is very useful. But could you help me to get the recent posts from wordpress.