DCSIMG
Posting to Community Server from C# using the MetaWeblog API - Guy Burstein's Blog

Guy Burstein's Blog

Developer Evangelist @ Microsoft

News

Guy Burstein The Bu

Disclaimer
Postings are provided 'As Is' with no warranties and confer no rights.

Guy Burstein LinkedIn Profile

TwitterCounter for @bursteg

Posting to Community Server from C# using the MetaWeblog API

What is the MetaWeblog API? 
The MetaWeblog API (MWA) is a programming interface that allows external programs to get and set the text and attributes of weblog posts. It builds on the popular XML-RPC communication protocol, with implementations available in many popular programming environments. Read more
here

Since this API is exposed from the Weblogs providers, programmer have to use a client-side programming model to communicate with it according to the XML-RPC protocol. Josh Gough has created and published this C# programming wrapper which allows us to easily develop C# client applications that consumes this API via a service.

How do you get started ?

  1. Download the Community Server MetaWeblog Proxy assemblies.
  2. Create a .Net application and reference the CookComputing.XmlRpc that come in the above .zip file.
  3. Create a class for the API provided by Josh Gough. You can copy the contents of the API from his post.
  4. Notice that the above post contains an implemention of IBlogger interface, which is decorated with [XmlRpcUrl("…metablog.ashx")] attribute. Don't forget to change the URL of your Community Server Blogs metaBlog.
  5. Now you can easily use the proxy in your code.

Example:

using MetaBlogAPI;

IBlogger proxy = MetaBlogAPIFactory.Create();
string user = "user";
string password = "password";
string blogid = "bursteg";

// Create a post. There are some optional properties such as Categories
// that were not supplied in this sample.
Post p = new Post();p.title = "Bloging from C# code";
p.dateCreated =
DateTime.Now;
p.description = "Can you see it?";
string postid = proxy.newPost(blogid, user, password, p, true);

Great, isn't it?

My next step is to write a workflow activity that posts an entry to my blog. Look forward for it!

Enjoy!

Comments

Community Server Daily News said:

Another Day of Celebration as Dan Bartels marks his One-Year Anniversary with Telligent. Dan gets bored
# June 15, 2006 9:30 PM

Daily News Faq List said:

Guy Burstein writes how to post to Community Server blogs in C# using the MetaWeblog API . I..... LIKE

# November 22, 2006 6:55 PM

Guy Burstein's Blog said:

This is my #200 post, and it is a good time to look back at what I've posted over the last few months.

# March 9, 2007 8:47 PM

Community Server Bits said:

Guy Burstein writes how to post to Community Server blogs in C# using the MetaWeblog API . I..... LIKE

# March 12, 2007 6:11 PM

zxevil172 said:

zQm9Vg      Were a U from?

# March 28, 2008 12:33 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: