Using JoeBlogs -metaWeblog API Wrapper
July 7th, 2009 Posted in Blogging, Geek Speak, Web
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

Include AlexJamesBrown.JoeBlogs in your class, with using / Imports:
C#
using AlexJamesBrown.JoeBlogs;
VB
Imports AlexJamesBrown.JoeBlogs
Step 4:
Instantiate a new Wrapper object.
So far, the available wrappers are:
MetaWeblogWrapper
WordPressWrapper
C#
WordPressWrapper wrapper = new WordPressWrapper(Url, Username, Password);
VB
Dim wrapper As New WordPressWrapper(Url, Username, Password)
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#
string Url = "www.alexjamesbrown.com"; string User = "MyUser"; //enter your username string Password = "MyPassword"; //enter your password var wp = new WordPressWrapper(Url, User, Password); //a few test functions... var userBlogs = wp.GetUserBlogs(); var tags = wp.GetTags(); var categories = wp.GetCategories(); var authors = wp.GetAuthors();
July 7th, 2009 at 4:43 pm
[...] here for usage instructions: http://www.alexjamesbrown.com/geek/using-joeblogs/ Share [...]
August 11th, 2009 at 5:28 am
Hi,
Noticed your source code is missing a class “BaseWrapper” on the latest version.
August 11th, 2009 at 11:21 pm
Thanks for the notification.
I’ve added the missing file to revision 25150
August 18th, 2009 at 2:17 am
do you support other blog system beside wordpress?
August 23rd, 2009 at 11:44 pm
yes, anything that supports the metaWeblog API
What blog system are you using?
August 26th, 2009 at 10:28 am
I get an exception “Response XML not valid XML-RPC – missing methodResponse element.” if i place a breakpoint here:
try
{
BlogID = GetUserBlogs()[0].blogid;
}
catch(Exception ex)
{
BlogID = string.Empty;
}
Thanks anyway its an easy to use solution (if i get it to work)
August 27th, 2009 at 7:31 pm
I get:
XmlRpcIllFormedXmlException: Response from server does not contain valid XML.
from:
var userBlogs = wp.GetUserBlogs();
i tried both the wp blog i have at wordpress.com and one hosted on my own site, got the same result.
August 28th, 2009 at 12:26 am
im getting a few errors like this recently…
I’ll check over the code – i’m thinking maybe an update to wp has broken it?
What version are you running?
August 28th, 2009 at 6:13 pm
This is both from the current version of wordpress.com, and version 2.8.1 on my hosting site
August 31st, 2009 at 10:31 am
Thanks for reporting the error – it is now fixed.
Please see this post:
http://www.alexjamesbrown.com/geek/development/dotnet/joeblogs-typo-in-dummy-url-fixed/
September 1st, 2009 at 10:08 pm
Do you have a sample code for posting new post with categories included?
It errors out for me with “Response from server does not contain valid XML.”
September 12th, 2009 at 5:40 pm
Hi, does your wrapper has that NewPost function implemented? I can’t get it to work
Pls help
September 16th, 2009 at 8:32 pm
Nevermind my previous post – I got it to work.
But I have another problem – in your wrapper there’s no way to add tags to new post or edit them, but I found that it can be done with the struct “mt_keywords”, I think it can be easily added to your wrapper, but I don’t have the possibility to test it since I have Visual Studio 2005 only, and your project was done in VS 2008 (??). So could you check if adding:
public string[] mt_keywords;
in the Page.cs file (under the Page structs section) would work for adding tags to new post? I think it should, as I’ve read about it, but I can’t check it right now.
October 12th, 2009 at 2:51 pm
@Milo can you tell me how NewPost function works?
October 12th, 2009 at 9:34 pm
Hi,
I wrote a post on using the NewPost method:
http://www.alexjamesbrown.com/development/creating-a-new-post-in-wordpress-using-the-joeblogs-library/
October 13th, 2009 at 1:29 pm
hi there, great extension..i would like to ask something..the getPost() throws an error when executed. it seems that the response contains an integer when the struct expects a string..would you mind looking into this? thank you so much..:)
October 27th, 2009 at 12:13 pm
Please assist how GetOptions work?
October 28th, 2009 at 1:06 pm
hello dear,
i had used your dll for publishing post on the ‘wordpress’ account, and they worked perfectly. very good job indeed. can you please confirm if your dll works for Live Journal also. if yes can you give me sample code.
look forward to hear from you soon.
regards
navjot
November 20th, 2009 at 3:43 pm
Hey Alex -
Great job – really great! I was working with Wordpress.NET, but got hung up on the limitation of having to hard code the URL, username and password. I am an intermediate C# developer. Many of the techniques of mapping Interface methods to the XMLRPC dll are brand new and a bit fuzzy. Your tool is a great find.
Thanks,
Sean Olson
January 19th, 2010 at 10:32 am
Hello,
this VB code works fine for me to add a new post.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim wrapper As New WordPressWrapper("http://myblog/xmlrpc.php", "admin", "secret")
'create a new post
Dim post As New Post()
post.dateCreated = DateTime.Now
post.title = "This is a title"
post.description = "this is the body of the post. it could be html Rev."
post.postid = "12345678"
wrapper.NewPost(post, True)
End Sub
Is there any sample code for editing an existing post? I want to modify a post from VB, but I am not sure how to get the postid. Would it be possible to search for the ID of a post? I do have the post title, but not the ID.
January 23rd, 2010 at 4:40 am
You are a legend Alex.
Many thanks for creating this great/simple/clean plugin.
Perfect for just a few simple things like “Displaying the latest posts automatically from your wordpress blog on your ASP.Net main site”..
February 7th, 2010 at 4:49 am
[...] Alex James Brown » Using JoeBlogs -metaWeblog API Wrapper [...]