Exemplo n.º 1
0
 /**
  * @return void
  */
 public function testGetUserPosts()
 {
     $posts = $this->_delicious->getUserPosts(self::TEST_UNAME, 10);
     $this->assertType('Zend_Service_Delicious_PostList', $posts);
     // check if all objects in returned Zend_Service_Delicious_PostList
     // are instances of Zend_Service_Delicious_SimplePost
     foreach ($posts as $post) {
         $this->assertType('Zend_Service_Delicious_SimplePost', $post);
     }
     // test filtering of Zend_Service_Delicious_PostList by tag name
     $filterPostList = $posts->withTag('zfSite');
     foreach ($filterPostList as $post) {
         $this->assertType('array', $post->getTags());
         $this->assertContains('zfSite', $post->getTags());
     }
 }
Exemplo n.º 2
0
 /**
  * For an individual tag
  *
  * @param string $user 
  * @param string $count 
  * @param string $tag 
  * @return void
  * @author Dan Chadwick
  */
 private function get_user_posts_by_tag($user, $count, $tag)
 {
     $links = array();
     $delicious = new Zend_Service_Delicious();
     try {
         $posts = $delicious->getUserPosts($user, $count, $tag);
         foreach ($posts as $post) {
             $links[] = array('title' => $post->getTitle(), 'url' => $post->getUrl());
         }
         return $links;
     } catch (Exception $e) {
         Kohana::log('debug', 'Delicious err.' . $e->getMessage());
     }
 }