Search code examples
phpapibloggerblogspot

Add Categories to Blogger with Google Api?


I am using the Zend Google API for posting to my blogger (Blogspot) Blog. I can enter only the Title and Content but I don't know how to add categories (also known as "Labels"). Is there a way to use the Zend Api to post to blogger with Categories?

Thanks!


Solution

  • http://groups.google.com/group/bloggerdev/browse_thread/thread/84053cb152af6423/e76330903c5061f7?lnk=gst&q=category

    $labels = $entry->getCategory(); 
    $newLabel = $gdClient->newCategory('testlabel2', 'http://www.blogger.com/atom/ns#'); 
    $labels[] = $newLabel; // Append the new label to the list of labels. 
    $entry->setCategory($labels);