当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata::newContent方法代码示例

本文整理汇总了PHP中Zend_Gdata::newContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata::newContent方法的具体用法?PHP Zend_Gdata::newContent怎么用?PHP Zend_Gdata::newContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Gdata的用法示例。


在下文中一共展示了Zend_Gdata::newContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: post

 public function post($param)
 {
     $asin = $xml->Items->Item->ASIN;
     $title = $param['title'];
     $content = $param['content'];
     $keyword = $param['keyword'];
     /* Post to Blogger */
     $client = Zend_Gdata_ClientLogin::getHttpClient($param['email'], $param['password'], 'blogger', null, Zend_Gdata_ClientLogin::DEFAULT_SOURCE, null, null, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE');
     $gdClient = new Zend_Gdata($client);
     $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/default/blogs');
     $feed = $gdClient->getFeed($query);
     $uri = 'http://www.blogger.com/feeds/' . $param['blog_id'] . '/posts/default';
     $entry = $gdClient->newEntry();
     $entry->title = $gdClient->newTitle($title);
     $entry->content = $gdClient->newContent($content);
     $entry->content->setType('text');
     $createdPost = $gdClient->insertEntry($entry, $uri);
     $idText = split('-', $createdPost->id->text);
     $url = $createdPost->link[4]->href;
     $newPostID = $idText[2];
     return $newPostID;
 }
开发者ID:pratikparmar111,项目名称:cblogger-robot,代码行数:22,代码来源:blogger.php

示例2:

<?php

require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$username = 'user@example.com';
$password = 'password';
$service = 'blogger';
$client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service);
$gdata = new Zend_Gdata($client);
$entry = $gdata->newEntry();
$category = $gdata->newCategory();
$category->setScheme('http://www.blogger.com/atom/ns#');
$category->setTerm('Test Label');
$entry->setCategory(array($category));
$content = $gdata->newContent();
$content->setText("Hello world");
$entry->setContent($content);
$gdata->insertEntry($entry, "http://www.blogger.com/feeds/8273578352962669317/posts/default");
开发者ID:Tony133,项目名称:zf-web,代码行数:19,代码来源:zf7013-test.php


注:本文中的Zend_Gdata::newContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。