2 messages in com.googlegroups.bloggerdevRe: API publish my post as a draft wh...| From | Sent On | Attachments |
|---|---|---|
| fra-o_o | 31 Mar 2008 19:12 | |
| Jeff Scudder | 01 Apr 2008 09:27 |
| Subject: | Re: API publish my post as a draft when that's not what i want![]() |
|---|---|
| From: | Jeff Scudder (j....@google.com) |
| Date: | 04/01/2008 09:27:25 AM |
| List: | com.googlegroups.bloggerdev |
On Mar 31, 7:12 pm, fra-o_o <fran...@gmail.com> wrote:
Hey all,
Running to another problem! I'm trying to post a new Post in PHP (and I am not using the Zend GData Framework). Posting seems ok, but my post is published as draft. Any idea?
-- i am connecting through clientLogin
the function: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function PublishPost($title,$post,$author_name,$author_mail) { $entry = "<entry xmlns='http://www.w3.org/2005/Atom'> <title type='text'>$title</title> <app:control xmlns:app=\"http://purl.org/atom/app#\"> <app:draft>no</app:draft> </app:control> <content type='xhtml'> <div xmlns=\"http://www.w3.org/1999/xhtml\"> $post </div> </content> <author> <name>$author_name</name> <email>$author_mail</email> </author> </entry>" ;
$pubPost_req = new HttpRequest () ;
$pubPost_req -> setRequestHeaders ( 'Authorization'
, 'GoogleLogin
auth='.$this->Auth ) ;
$pubPost_req -> setRequestHeaders ( 'Content-Type'
, 'application/
atom+xml' ) ;
$pubPost_req -> open ( 'POST' , $this->posts_loc ) ;
$pubPost_req -> send ( $entry ) ;
return $pubPost_req->feedBack; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I don't think the problem comes from the BlogID or anything, because there are class constants and they work fine with other methods of this class, and authentication works great. The only function I have running right now is to delete a post -- this works OK!
This is a somehow detailed feedback i have from GDATA:
<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet
href="http://www.blogger.com/styles/atom.css" type="text/css"?>
<entry xmlns='http://www.w3.org/2005/Atom'>
<id>tag:blogger.com,1999:blog-xxxxx.post-xxxx</id>
<published>2008-03-31T18:58:00.001-07:00</published>
<updated>2008-03-31T18:58:42.498-07:00</updated>
<app:control xmlns:app='http://purl.org/atom/app#'>
<app:draft>yes</app:draft>
</app:control>
<title type='text'>Salut</title>
<content type='html'>xxxx</content>
<link rel='replies' type='text/html' href='http://www.blogger.com/
comment.g?blogID=xxxx&postID=xxx' title='0 Comments'/>
<link rel='self' type='application/atom+xml'
href='http://www.blogger.com/feeds/xxxx/posts/default/xxxx'/>
<link rel='edit' type='application/atom+xml'
href='http://www.blogger.com/feeds/xxxx/posts/default/xxxx'/>
<author><name>fra-o_o</name></author></entry><br />
[transfer] => Array<br /> (<blockquote><br /> [url] =>http://www.blogger.com/feeds/xxxxxx/posts/default<br/> [content_type] => application/atom+xml; charset=UTF-8<br /
[http_code] => 201<br /> [header_size] => 405<br />
[request_size] => 757<br /> [filetime] => -1<br /> [ssl_verify_result] => 0<br /> [redirect_count] => 0<br /> [total_time] => 0.454<br /> [namelookup_time] => 0.09<br />
[connect_time] => 0.184<br /> [pretransfer_time] => 0.184<br /> [size_upload] => 0<br /> [size_download] => 1081<br /> [speed_download] => 2381<br /> [speed_upload] => 0<br />
[download_content_length] => 0<br /> [upload_content_length] => 0<br /> [starttransfer_time] => 0.388<br /> [redirect_time] => 0<br /> </blockquote>)<br />
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Basically, it works but post it in draft when I want it not to. Any suggestion would be greatly appreciated?
Thanks for reading
fra-o_o
Hi fra-o_o,
The first thing I can think of is that the blog may have been set so that all posts are saved as drafts instead of being published. There is an explanation and solution on this thread:
http://groups.google.com/group/bloggerDev/browse_thread/thread/baa6ee6d5bdb9a7e
If that wasn't the issues, please let me know.
Happy coding,
Jeff




