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


PHP Zend_Service_Delicious::getRecentPosts方法代码示例

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


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

示例1: testGetRecentPosts

 /**
  * Ensures that getRecentPosts() provides expected behavior
  *
  * @return void
  */
 public function testGetRecentPosts()
 {
     $posts = $this->_delicious->getRecentPosts('zfSite', 10);
     $this->assertType('Zend_Service_Delicious_PostList', $posts);
     $this->assertTrue(count($posts) <= 10);
     foreach ($posts as $post) {
         $this->assertContains('zfSite', $post->getTags());
     }
 }
开发者ID:travisj,项目名称:zf,代码行数:14,代码来源:PrivateDataTest.php

示例2: fetch

 public function fetch()
 {
     if ($this->_disabled) {
         return array();
     }
     $frontendOptions = array('lifetime' => $this->_config->cacheLifetime, 'automatic_serialization' => true);
     $backendOptions = array('cache_dir' => $this->_config->cacheDir);
     $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
     if (!($this->_items = $cache->load('delicious'))) {
         $delicious = new Zend_Service_Delicious($this->_config->username, $this->_config->password);
         $results = $delicious->getRecentPosts(null, $this->_config->limit);
         $this->_items = array();
         foreach ($results as $entry) {
             $this->_items[] = new Polycast_Stalker_Item_Delicious($entry->getTitle(), $entry->getUrl(), $entry->getTags(), new DateTime($entry->getDate()->toString()), $entry->getNotes(), $this->_config->items);
         }
         $cache->save($this->_items, 'delicious');
         uasort($this->_items, array('Polycast_Stalker', 'sortItems'));
         $this->_items = array_slice($this->_items, 0, $this->_config->limit, true);
     }
     return count($this->_items);
 }
开发者ID:polycaster,项目名称:Polycast_Stalker,代码行数:21,代码来源:Delicious.php

示例3: get_links_by_tag

 /**
  * Gets posts by tags if necessary for a username and password
  *
  * @param string $username (del feed)
  * @param string $password	
  * @param string $tags tags to look for (array or comma separated string)
  * @param int $count
  * @return array $links array of links
  * @author Dan Chadwick
  */
 public function get_links_by_tag($username, $password, $tags = null, $count = 10)
 {
     if (!is_array($tags)) {
         $findtags = array();
         if (strpos($tags, ',') !== false) {
             foreach (split(',', $tags) as $value) {
                 $findtags[] = $tags;
             }
         } else {
             $findtags[] = $tags;
         }
     }
     $links = array();
     $delicious = new Zend_Service_Delicious($username, $password);
     $posts = $delicious->getRecentPosts($findtags, $count);
     // Print posts having "php" and "zend" tags
     foreach ($posts as $post) {
         $links[] = array('title' => $post->getTitle(), 'url' => $post->getUrl());
     }
     return $links;
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:31,代码来源:delicious.php


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