當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。