WordPress 2.7 XML-RPC wrapper for .Net

In a previous posting I described a .Net wrapper for WordPress 2.5. In this new incarnation I’ve added access to the new XML-RPC methods of WP 2.7 like:

  • GetTags
  • GetComments
  • GetPages
  • GetPage

and an easier API by defining the credentials as constants.  All this allows you now to consult and manage your WP blog through calls like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
WP wp=new WP();
Page[] ps = wp.GetPages(3);
Page page= wp.GetPage("655");
Post post = wp.GetPost("1068");
UserInfo info= wp.GetUserInfo();
CommentFilter f = new CommentFilter() { number = 12,offset = 0,post_id = 1068,status = "approve"};
Comment[] c = wp.GetComments(f);
Post[] p = wp.GetRecentPosts(3);
Category[] cats= wp.GetCategories();
TagInfo[] t = wp.GetTags();
 
Image im= Bitmap.FromFile(@"C:\temp\thumbup.jpg");
byte[] barray = WP.ConvertImageToByteArray(im, ImageFormat.Jpeg);
MediaObject media = new MediaObject() { name = "wpapi.jpg", type ="jpg", bits = barray};
MediaObjectInfo minfo = wp.NewMediaObject(media);

You can download this Visual Studio project and don’t forget to fetch a copy of the XML-RPC.Net library from Cook computing (there is a version in the VS solution though).

33 Responses to WordPress 2.7 XML-RPC wrapper for .Net

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

top