
![]() |
imred
Hey guys,
I am just stuck on this one... I created a way to post content to my blogs from vb .netwithout issue using XML-RPC. However, the problem is that I cannot get it to go to a particular category nor utilize tagging![]() Anyone have any code to do this? Here is my code for posting to Wordpress: --------------------------------------------------------------------------- <XmlRpcUrl("http://www.myblogurlgoeshere.com/xmlrpc. php"![]() Public Interface IWP Inherits IXmlRpcProxy <XmlRpcMethod("blogger.newPost" ![]() Function newPost(ByVal args() As String) As Integer End Interface In a button-click event (eventually on a timer): Dim proxy As IWP = XmlRpcProxyGen.Create(Of IWP)() Dim args() As String = {"", "", "{usernamehere}", "{passwordhere}", {postcontenthere}, "publish"} errorreturn = proxy.newPost(args) --------------------------------------------------------------------------- Any ideas on how I can get Category and Tags into the mix on this ![]() ![]() I need to take content and replace words using a synonym database... I can figure it out myself, but would prefer to have some good code to start with ![]() Thanks in advance! vsloathe
The beauty of XMLRPC is that it is whatever you tell it to be. Check the docs of WP's XMLRPC, I went through this same headache a while ago. The answer is yes, if WP allows you to choose category and tagging.
I will check some of my docs from when I was banging my head against the wall with this and let you know what I find. I was doing mine in PHP, but an XMLRPC packet is an XMLRPC packet is an XMLRPC packet.vsloathe
Ok, looks like what I did was this:
Inside your "post content" field, you can use tags to specify the category, etc. This is how I was doing it in PHP:<? php$client = new xmlrpc_client($xmlrpcurl); $params[] = new xmlrpcval("n/a"); $params[] = new xmlrpcval("n/a"); $params[] = new xmlrpcval($username); //your wordpress login $params[] = new xmlrpcval($password); //your wordpress password $params[] = new xmlrpcval( "<title>Title</title>". //the title of your post "<category>Category</category>". //the category $body); //the body $params[] = new xmlrpcval("true"); //publish now = true ?> DangerMouse
Wordpress supports Blogger, MetaWeblog and MovableType (I think) APIs, so if you concentrate your search there you should be able to find out the correc xmlrpc methods and the correct structure for your xml.
I'm pretty sure there is a way to call some kind of reflection command on the Wordpress xmlrpc. phpfile aswell, this will detail all the xmlrpc methods supported, but I don't recall where I saw that sorry.DM imred
I think I am seeing the problem...
I decided to use Cook Computing's XMLRPC wrapper... Because of this, I am allowing them to create the XML packet. And, since this is the case, I am having a difficult time sending over different information. I'll have to re-think this approach and possibly use an alternative method with vb .net.thanks guys! That DID help. imred
quote author=DangerMouse link=topic=818.msg5608#msg5608 date=1204924766 Wordpress supports Blogger, MetaWeblog and MovableType (I think) APIs, so if you concentrate your search there you should be able to find out the correc xmlrpc methods and the correct structure for your xml. I'm pretty sure there is a way to call some kind of reflection command on the Wordpress xmlrpc. phpfile aswell, this will detail all the xmlrpc methods supported, but I don't recall where I saw that sorry.DM I did look, pretty heavily into that file (xmlrpc. php ![]() I think I know it pretty good, it's just the way it extracts everything... and since I wasn't creating the XML myself, I really didn't think about it ![]() phpfile.imred
ok, I got it (at least adding a title and putting it into a category).
Using the Blogger API for new post, you have to have: <category>3</category> instead of the actual name of the category ![]() DangerMouse
I believe theres a method from the blogger api that will allow you to return all the available categories, so it should be possible to grab the number from that rather than having to know it before hand.
DM nutballs
actually if you hit the mt_keywords method in the rpc it will just add what you send as tags. not categories, but then again, you dont have to dick with the stupid categories silliness that goes on in there, as you discovered. tags are good enough imo.
imred
Thanks Dangermouse - yes, there is the categories piece that I am using, but it brings back the category name
![]() ![]() Nutballs - that sounds like a good idea. I get more out of tagging than categories anyway. Thanks! |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads