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


PHP Zend_Feed::findFeeds方法代码示例

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


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

示例1: importData

 public function importData()
 {
     $url = $this->getProperty('url');
     try {
         $feeds = Zend_Feed::findFeeds($url);
     } catch (Zend_Feed_Exception $e) {
         return 0;
     }
     if (!$feeds) {
         try {
             $items = Zend_Feed::import($url);
         } catch (Zend_Feed_Exception $e) {
             return 0;
         }
         $feed_url = $url;
     } else {
         $feeds_uri = array_keys($feeds);
         $feed_url = $feeds_uri[0];
         $items = $feeds[$feed_url];
     }
     $title = $items->title();
     $this->setProperty('feed_title', $title);
     $this->setProperty('feed_url', $feed_url);
     $items = $this->updateData();
     $this->setImported(true);
     return $items;
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:27,代码来源:RssModel.php

示例2: importData

 public function importData()
 {
     $username = $this->getProperty('username');
     $url = "http://feeds.launchpad.net/~{$username}/revisions.atom";
     try {
         $feeds = Zend_Feed::findFeeds($url);
     } catch (Zend_Feed_Exception $e) {
         return 0;
     }
     if (!$feeds) {
         try {
             $items = Zend_Feed::import($url);
         } catch (Zend_Feed_Exception $e) {
             return 0;
         }
         $feed_url = $url;
     } else {
         $items = $feeds[0];
         $feed_url = Zend_Feed::getHttpClient()->getUri(true);
     }
     $title = $items->title();
     $this->setProperty('feed_title', $title);
     $this->setProperty('feed_url', $feed_url);
     $items = $this->updateData();
     $this->setImported(true);
     return $items;
 }
开发者ID:jmhobbs,项目名称:storytlr,代码行数:27,代码来源:LaunchpadModel.php

示例3: importData

 public function importData()
 {
     $url = $this->getProperty('url');
     $feeds = Zend_Feed::findFeeds($url);
     if (!$feeds) {
         $items = Zend_Feed::import($url);
         $feed_url = $url;
     } else {
         $items = $feeds[0];
         $feed_url = Zend_Feed::getHttpClient()->getUri(true);
     }
     $this->setProperty('feed_url', $feed_url);
     $items = $this->processItems($items, 'published');
     $this->setImported(true);
     return $items;
 }
开发者ID:vicox,项目名称:storytlr,代码行数:16,代码来源:GooglereaderModel.php

示例4: importData

 public function importData()
 {
     $url = $this->getProperty('url');
     $feeds = Zend_Feed::findFeeds($url);
     if (!$feeds) {
         $items = Zend_Feed::import($url);
         $feed_url = $url;
     } else {
         $feeds_uri = array_keys($feeds);
         $feed_url = $feeds_uri[0];
         $items = $feeds[$feed_url];
     }
     $this->setProperty('feed_url', $feed_url);
     $items = $this->processItems($items);
     $this->setImported(true);
     return $items;
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:17,代码来源:GooglereaderModel.php

示例5: testFindFeedsIncludesUriAsArrayKey

 /**
  * @issue ZF-5903
  */
 public function testFindFeedsIncludesUriAsArrayKey()
 {
     if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED') || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')) {
         $this->markTestSkipped('testFindFeedsIncludesUriAsArrayKey() requires a network connection');
         return;
     }
     Zend_Feed::setHttpClient(new Zend_Http_Client());
     $feeds = Zend_Feed::findFeeds('http://www.planet-php.net');
     $this->assertEquals(array('http://www.planet-php.org:80/rss/', 'http://www.planet-php.org:80/rdf/'), array_keys($feeds));
 }
开发者ID:travisj,项目名称:zf,代码行数:13,代码来源:ImportTest.php

示例6: retrieveSinceLastFetch

 function retrieveSinceLastFetch($uri, $idcontact_website = null)
 {
     $do_website = new ContactWebsite();
     $do_website->getid($idcontact_website);
     $last_fetch_time = $do_website->feed_last_fetch;
     $website_type = $do_website->website_type;
     if ($website_type == "RSS Feed") {
         try {
             $feed = new Zend_Feed_Rss($uri);
             $arr_item = array();
             $i = 0;
             foreach ($feed as $entry) {
                 if (trim($entry->title()) == trim($entry->description())) {
                     $str_item .= $entry->description() . "<br />";
                 } else {
                     $str_item = "<B>" . $entry->title() . "</B><br />";
                     $str_item .= $entry->description() . "<br />";
                 }
                 $str_item .= " " . date("D, j M Y H:i:s", strtotime($entry->pubDate())) . "<br />";
                 $arr_item[$i][0] = $str_item;
                 $arr_item[$i][1] = strtotime($entry->pubDate());
                 $i++;
                 if ($last_fetch_time > strtotime($entry->pubDate())) {
                     break;
                 }
             }
             return $arr_item;
         } catch (Exception $ex) {
             $this->turnFeedOff($idcontact_website);
         }
     } else {
         try {
             $obj_arr_feeds = Zend_Feed::findFeeds($uri);
             $arr_item = array();
             $i = 0;
             foreach ($obj_arr_feeds as $channel) {
                 if ($channel->item) {
                     //fetches the first (current) updated item
                     $item = $channel->current();
                     if (trim($item->title()) == trim($item->description())) {
                         $str_item .= $item->description() . "<br />";
                     } else {
                         $str_item = "<B>" . $item->title() . "</B><br />";
                         $str_item .= $item->description() . "<br />";
                     }
                     $str_item .= " " . date("D, j M Y H:i:s", strtotime($item->pubDate())) . "<br />";
                     $arr_item[$i][0] = $str_item;
                     $arr_item[$i][1] = strtotime($item->pubDate());
                     $i++;
                     if ($last_fetch_time > strtotime($item->pubDate())) {
                         break;
                     }
                 }
             }
             return $arr_item;
         } catch (Exception $ex) {
             $this->turnFeedOff($idcontact_website);
         }
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:60,代码来源:Feed.class.php


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