Mango



Thread: Cross Publishing Issues

Created on: 08/05/10 10:58 AM

New topic Reply    Page: 1  

Replies: 1
vdixit14


vdixit14's Gravatar
Joined: 07/15/10
Posts: 7

08/05/10 10:58 AM

I think would be good to start a new thread..

have 2 mango blogs, such-
1. applications/myBlogA/
2. applications/myBlogB/

From myBlogA I am trying to post to myBlogB (author and categories exist on both), using API.
<cfscript>
myBlogBAPI = createObject("component", "applications.myBlogB.api.API");
postID = myBlogBAPI.newPost(argumentCollection=data);

</cfscript>

But it keeps posting back to Blog A- even though in the code above you can clearly see I am posting to Blog B. So everytime- i enter a post in admin section to Blog A I end up havi 2 blog post of same in Blof A.

Any pointers, thoughts, ideas- as to what I am doing wrong here.
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1521

08/08/10 6:58 PM

You can't post to blogB from blogA because the API will use the current blog you are in to make the post. If you need to do that, then I would suggest using the API but calling it via web services:
myBlogBAPI = createObject("webservice", "http://yourblog/myBlogB/api/API.cfc?wsdl";);
postID = myBlogBAPI.newPost(argumentCollection=data);

or
myBlogBAPI = createObject("webservice", "http://yourblog/myBlogB/api/APIService.cfc?wsdl";);
result = myBlogBAPI.newPost(argumentCollection=data);

if you want to get more information besides the post id
Link | Top | Bottom

New Post

Please login to post a response.