On Feb 14, 3:35 am, stanza <stan...@gmail.com> wrote:
Hi,
I am able to post simple posts on blogger using the Zend_Gdata.
However, I have no idea how to add photos to the posts.
What I currently try is something like:
$client = Zend_Gdata_ClientLogin::getHttpClient($this->username,
$this->password, 'blogger');
$gdClient = new Zend_Gdata($client);
$entry = $gdClient->newMediaEntry();
$source = new Zend_Gdata_App_MediaFileSource($file);
$source->setContentType("image/jpg");
$entry->setMediaSource($source);
$uri = "http://www.blogger.com/feeds/" . $this->externalID . "/posts/
default";
$createdPost = $gdClient->insertEntry($entry, $uri);
What I get in return is a message:
Expected response code 200, got 415
Can anyone help?
When you upload images through the Blogger UI, they are saved in
Picasa Web Albums. It just so happens that Picasa Web Albums has a
Google Data API which is very similar to the Blogger API. The
Zend_Gdata library has a client for Picasa, so you may already have
everything you need. The documentation and other resources for the
Picasa Web Albums API can be found here:
http://code.google.com/apis/picasaweb/overview.html
Happy coding,
Jeff