DCSIMG
Manipulate Your Blog with MetaBlog API for C# - 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

Links

Articles

Blogs I Read

Manipulate Your Blog with MetaBlog API for C#

Manipulate Your Blog with MetaBlog API for C#

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.

For example:

IBlogger proxy = MetaBlogAPIFactory.Create();

Post[] posts = proxy.getRecentPosts("bursteg", "username", "password", 1000);

 

var query = from p in posts

            where p.categories.Contains("VS2008")

            select new { Title = p.title, Link = p.permalink };

 

this.GridView.DataSource = query;

this.GridView.DataBind();

and with a little LINQ syntax, you can create a new query and show bind it to a grid.

Enjoy!

Comments

Guy Burstein [MVP] said:

How To: Create a RSS Syndication Service with WCF This post is a step by step guide for creating a Syndication

# December 3, 2007 11:05 AM

עומר ון קלוטן said:

Nice :D

# December 3, 2007 11:05 AM

nick_ricvid said:

# May 18, 2009 9:59 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: