I found some code that lets me post to a Wordpress blog via xmlrpc, but with zero control over categories. I need to be able to post to multiple cats and if possible also address the allow comments and allow trackbacks options for each post. Anybody here that can help.
Hours of Googling has revealed nothing of value.
Here's code I have so far that works for posting to default category.
It's using the Cook.Computing xmlrpc library for dot net that every one talks about.
Before all the subs and functions:
At the very top:
Then, just below the Form declaration:
The work is done here:
Can someone at least show me how to post to multiple categories?
Any help appreciated
Phil
Hours of Googling has revealed nothing of value.
Here's code I have so far that works for posting to default category.
It's using the Cook.Computing xmlrpc library for dot net that every one talks about.
Before all the subs and functions:
At the very top:
VB.NET:
Imports CookComputing.XmlRpc
Then, just below the Form declaration:
VB.NET:
Public Structure blogInfo
Public title As String
Public description As String
End Structure
Public Interface IgetCatList
<CookComputing.XmlRpc.XmlRpcMethod("metaWeblog.newPost")> _
Function NewPage(ByVal blogId As Integer, ByVal strUserName As String, ByVal strPassword As String, _
ByVal content As blogInfo, ByVal publish As Integer) As String
End Interface
The work is done here:
VB.NET:
Private Function _
PostToBlog() _
As Boolean
Try
Dim newBlogPost As blogInfo = Nothing
newBlogPost.title = "The Best Title Ever"
newBlogPost.description = "A new blog post for the world to see."
Dim categories As Object = CType(XmlRpcProxyGen.Create(GetType(IgetCatList)), IgetCatList)
Dim clientProtocol As Object = CType(categories, XmlRpcClientProtocol)
clientProtocol.Url = "http://myblog.com/xmlrpc.php"
Dim result As String = Nothing
result = categories.NewPage(1, "username", "password, newBlogPost, 1)
Say("ALL DONE!")
Return True
Catch ex As Exception
Dim msg As String = "FUNCTION: PostToBlog ::: " _
& ex.Message & " ::: " _
& Now.ToString()
LogError(msg)
Return False
End Try
End Function
Can someone at least show me how to post to multiple categories?
Any help appreciated
Phil
Last edited: