Alex

Using JoeBlogs -metaWeblog API Wrapper

July 7, 2009

Step 1

Download the latest release of JoeBlogs from Codeplex
(Click the Downloads tab, and select the latest download)

Step 2

Unzip the contents of the downloaded zip file.
(I usually copy DLLs I am going to use into a “lib” folder at the root of my solution)

Step 3


Add a reference to BOTH CookComputing.XmlRpcV2.dll AND JoeBlogs.dll

image

Include AlexJamesBrown.JoeBlogs in your class, with using / Imports:

C#

VB

Step 4:

Instantiate a new Wrapper object.

So far, the available wrappers are:

MetaWeblogWrapper

WordPressWrapper

C#

VB

Please note -

The above example has the Url, Username and Password strings omitted. Simply replace them with the relevant information.

Step 5

You can now take full advantage of all the methods on your instantiated wrapper.

C#


TAGS: - - -


# Back

  • Steve

    Is there also any way to get the last post full url from the wrapper? I’ve check through and cannot find a way to get this?

  • http://www.cybosofttech.com/feed Manish Choudhary

    I want to upload image to my blog using your API but what is the field bits in the structure? I converted my file to byte array but the uploaded image is corrupted.
    Help pleaaaaaaaaaaaaaaaaaaaase.

  • Kay

    Have the same problem with invalid XML:

    + $exception {“Response from server does not contain valid XML.”} System.Exception {CookComputing.XmlRpc.XmlRpcIllFormedXmlException}

    I used latest source code.

  • Kay

    Ok, got it working – I stumbled across the url typo ;-)

    Retrieving categories and posting in general works well, but I am not able to set the category to post in.

    var post = new Post();

    //since this is a struct, we can’t have a constructor that does this!
    //post.dateCreated = DateTime.Now;
    post.DateCreated = DateTime.Now;
    post.Title = “This is a title”;
    post.Body = “this is the body of the post. it could be html.”;
    post.Categories = new int[] { 1,9 }; // no matter what I put in here, each post goes to category 1 (default I guess)
    post.Tags = new string [] {“test”, “test2″};

    //create the post!
    wrapper.NewPost(post, true);

  • IAM

    Add category and edit post is not working

  • Borisov

    Hello Alex,

    As the previous comment states, the add new category function is not working and it’s throwing the following error:
    [500] Sorry, the new category failed.

    The question is: IS there any way to fix this and if so, how?

    Thank you for your great work!

    Regards,
    Borisov

  • http://free-software-website.com James

    Hello,

    I am trying to add new category and the function throws 500 error. Is there any fix?

  • shan

    Hi Alex,

    I am getting and error when using GetRecentPosts method in WordPressWrapper. The error says “Reference to undeclared entity ‘raquo’. Line 9, position 78.”

    Can you please tell, what is causing this issue.

    Code for you reference : error occurred in line 3.

    1. WordPressWrapper wp = new WordPressWrapper(“http://localhost/wordpress/”, “admin”, “admin”);
    2. var posts = wp.GetRecentPosts(2);
    3. MessageBox.Show(posts.Count.ToString());

    thanks.

    Regards.

  • shan

    error occurred in line 2 not 3.

  • http://dilipm.wordpress.com Dilip

    Hey I am unable to use this dll and wrapper for wordpress.com site…I want to publish to dilipm.wordpress.com
    Unable to do it….getting such errors
    [401] Sorry, you do not have access to user data on this site. (when accessing wp.GetUserInfo(); )
    [401] Sorry, you must be able to edit posts on this site in order to view categories.(when accessing wp.GetCategories();)…
    Now if this is not possible with wordpress.com sites..how can android app like BlogAway Lite able to do publish posts to my blog!!!!?

  • Nitin

    link to codeplex is not working. can you please share the link from where i can download the DLLS.